Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Inspector Display: Collect property from a list of scriptable objects and show them as a list

Discussion in 'Scripting' started by MicDE, Oct 12, 2018.

  1. MicDE

    MicDE

    Joined:
    Dec 15, 2015
    Posts:
    16
    Hi,
    I have a small problem in showing properties in inspector coming from a list of scriptable objects.

    I have a scriptable object which contains a list of other scriptable objects. Those other scriptable objects have properties of different kinds. One is a reference to a Prefab.
    Code (CSharp):
    1. public class OuterScriptableObject : ScriptableObject
    2. {
    3.        public List<InnerScriptableObject> objectList;
    4. }
    5.  
    6. public class InnerScriptableObject : ScriptableObject
    7. {
    8.     public string name;
    9.     public GameObject prefab;
    10. }
    11.  
    12.  
    Now I want let the inspector draw a list of the prefab properties of InnerScriptableObject and let me edit all those prefab references in kind of a collected list.

    Can any one help me here, because I am very bad in coding for the unity editor.

    Best
    Mic