Search Unity

Showing a list of ScriptableObjects on Inspector

Discussion in 'Scripting' started by dullman, Aug 3, 2016.

  1. dullman

    dullman

    Joined:
    Jan 20, 2015
    Posts:
    29
    Hello I have a few lists of custom classes derived from ScriptableObjects and i want to display it on Inspector to easily add/remove items from list, I found an article which describe it for single Item, but what i want is to use List.
    for example i have a class
    Code (CSharp):
    1. public class Item : ScriptableObject
    and Monobehaviour derived class Items
    Code (CSharp):
    1. public class Items : MonoBehaviour {
    2.         public List<Item> BodyCollection;
    3.        ...
    4. }
    So my question is how to i make and editor file to display in editor List of editable fields of Item??
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
  3. dullman

    dullman

    Joined:
    Jan 20, 2015
    Posts:
    29
    Hmm are you answering my question?? Or you get wrong question since i do not never asked about popup question. My question is regards how to force to display List Of ScriptableObjects in Editor (with visible fields not refernce to object), I know it's works if we don't have scriptable objects but still i do need a scriptable object since I do read in documentation about serialization that it will work reference to objects.
     
  4. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    oh, ok... thought you meant a list you can pick one from, i.e. a drop down.


    (used to be*) good example of a custom editor to list out a scriptable object :)

    *hmmm looks like they've removed the public github source code and blog, so it's just the vid... :(


    also you might be interested by http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/scriptable-objects
    and looking at the live training schedule there are two more "stuff with scriptableobjects" sessions this month (yey live training is back :) )