Search Unity

How to make a ReorderableList with ScriptableObjects?

Discussion in 'Scripting' started by nicmarxp, Apr 9, 2019.

  1. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    406
    Hey all! :)

    Just found this neat way to create a ReorderableList of ScriptableObjects with inline editors, that can be of different types, that derive from the same class/SO.



    It seems it's not required to have a custom editors for all scriptable objects, but there might be more code than shown in the GIF, especially the ScriptableObjectDrawer which seem to do some magic.

    They talked about it in this thread but never posted any code.
    https://www.reddit.com/r/Unity3D/comments/7jxzhg/the_greatest_trick_unity_ever_pulled_was/

    The author of the GIF explains it like this:

    I'm very new to editor scripting and pretty new to scriptable objects, so I have a hard time convert what's said above to code.

    Is there anyone who has done this, or could explain how I would do this? I have Odin Inspector, which is great, but I think I need something else to do this. [InlineEditor] works, but I can't seem to add elements to the list.

    I'll gladly pay a few bucks to anyone who can help me, since it would save me a lot of time, that I'd rather spend on making the features of my game, rather than spending days on this.. :)

    Thanks!
     
    tyler_unity324 likes this.