- Home /
Question by
JUSTCAMH · Apr 11, 2019 at 03:53 AM ·
editorinspectoreditor-scripting
Make a class who's public variables are 'unfurled' in the inspector, even whilst in an array.
I am creating a class that is called a 'WeightedEntry', which contains a float (random weight) and a System.Object. The goal is to create a list of objects (be that floats, vectors or other classes) that can be randomly selected using random weights. The class works beautifully, but is a pain to use, due to how the inspector works with arrays.
I've currently got what's on the left, and would like something similar to what is on the right. I've tried using a custom editor, but they don't apply to classes that are in arrays.
good-array.png
(39.7 kB)
Comment
Answer by hexagonius · Apr 11, 2019 at 04:58 AM
Check out this awesome page, in particular the sections "Custom Data" and "Custom List"