Search Unity

AssetReferenceGameObject as non-MonoBehaviour field?

Discussion in 'Addressables' started by nrvllrgrs, Mar 23, 2020.

  1. nrvllrgrs

    nrvllrgrs

    Joined:
    Jan 12, 2010
    Posts:
    22
    How can I have a AssetReferenceGameObject as a field in a class that does not extend from MonoBehaviour or ScriptableObject?

    I have a ScriptableObject that has a list of objects where that object does not have an inheritance. And when it has a AssetReferenceGameObject field, it shows a constructor not found error (I am using Odin Inspector). Any thoughts?
     
  2. WaaghMan

    WaaghMan

    Joined:
    Jan 27, 2014
    Posts:
    217
    I guess it's a problem with the inspector, as we have plenty of AssetReferences in plain c# classes (referenced from parent ScriptableObjects).
     
unityunity