Unity Inspector Attribute - nomrand/__basics GitHub Wiki

Script

Attribute

RequireComponent

When attached the script which has this attribute to some object, automatically add required component. (It is no meaning, to add this Attribute to already attached script)

[RequireComponent(typeof(AutomaticallyAddedComponent))]
public class AttachingScript: MonoBehaviour {
...

Change Appearance

Just change the appearance of Inspcetor.

public class SomeScript: MonoBehaviour {
    [Header("Start Header Here")]
    public int someValue1;
    [Space]
    public int someValue2;
    [Space]
    [Space]
    public int someValue3;
...

Hide/Show value

Hide public value and show private value.

public class SomeScript: MonoBehaviour {
    [HideInInspector]
    public int hiddenValue;

    [SerializeField]
    private int dispValue;
...