Group variables in Unity 3d inspector with style!
Put attribute before variable and you are done !
[Foldout("DESIRED_NAME")]
public class Player : MonoBehaviour
{
[Foldout("Setup")] public Transform selfTransform;
[Foldout("Data")] public int HP;
[Foldout("Data")] public int AT;
}
You don't need to write [Foldout] attribute each time! Instead, you can add "true" bool check afther naming to put all properties to the specified group
public class Player : MonoBehaviour
{
[Foldout("DATA OBJECT", true)]
public int hp;
public int attack = 20;
[SerializeField]
private GameObject self;
[Foldout("DATA ATTACK")]
public int AT;
}
- Tag filters - an extension to add foldable groups to the inspector.
- ACTORS - Unity3d data-driven framework I'm currently working on.