Changing The Order Of Properties


You can easily change the order in which things are displayed, by applying a PropertyOrderAttribute, which takes a simple order number. Members are ordered first by their order number (which is 0 by default), and then by the order in which they are written in the script itself, though different member types will always be displayed separately (see below paragraph). Priorities are sorted in ascending order, meaning lower numbers are displayed first.

[PropertyOrder(1)]
public int Last;

[PropertyOrder(-1)]
public int First;

// All properties default to 0.
public int Middle;

As implied above, with Odin, you can show all kinds of things in the inspector; not just fields, but also properties and methods. Usually such members would be displayed separately, but with property ordering you can easily interweave members of all kinds with each other.

[PropertyOrder(2)]
public int Second;

[Button]
[PropertyOrder(1)]
public void First()
{
	// ...
}

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.