My old editor |
The tricky thing is that our item database consists of a list of classes. Unity does not support custom editor functions for lists, only for arrays. Luckily somebody in the Unity community hade the same problem and fixed it. He completely worked out the code and put it online. Big thanks to ForceX!
ForceX had a clever solution for the problem I had. He creates every value as a serialized object. This makes it easier to display using the EditorGUILayout.PropertyField() function.
My new editor |
My editor now supports an easy button for adding new items. You can easily add large amounts of items by adjusting the Database Size. The last item, usually the 'empty' items, can be deleted by clicking Delete Last. You can either show all items, or items from one certain type, for example only weapons. This editor is way better than the original editor Unity offered me.