I would like to create a struct array that would be shown (and editable) in Inspector. Well, that is easily possible with the Serializable and SerializeField attributes. The problem is, the layout is so bloaty that using an entirely different solution feels more tempting.
So the question is, how can I make each of the elements (shown in the below picture) to appear on a single line each with no need for the collapsible three row entities?
Ah excellent, thanks! I wonder how I missed that from the documentation. Works nicely! I even managed to make a header row for the booleans of the array (even though setting a CustomPropertyDrawer separately for an array didn’t seem to work).
Just one very small thing I couldn’t figure out: is there a way to set GUIContent alignment eg. to horizontal center? For example when using EditorGUI.LabelField(…) it would be nice to be able to align the text to the middle of the Rect, but at least by default it aligns to the left. This is of course of very minor importance as it’s easily dealt with by manual tweaking and some magic numbers though.
Uh, thanks! How awkwardly hasty of me. I actually thought about that GUIStyle, but due to a lack of time only happened to quickly check its constructors and looked for Setter methods (starting with S). But of course: there are far too many GUIStyle things (a lot more than just alignment) to configure to have it all in the constructor, and getter/setter methods more of a java thing.