Type Info Box Attribute

The TypeInfoBox attribute adds an info box to the very top of a type in the inspector. Use this to add an info box to the top of a class in the inspector, without having to use neither the PropertyOrder nor the OnInspectorGUI attribute.

public MyType MyObject = new MyType();

[InfoBox("Click the pen icon to open a new inspector for the Scripty object.")]
[InlineEditor]
public MyScriptyScriptableObject Scripty;

[Serializable]
[TypeInfoBox("The TypeInfoBox attribute can be put on type definitions and will result in an InfoBox being drawn at the top of a property.")]
public class MyType
{
    public int Value;
}

//[TypeInfoBox("The TypeInfoBox attribute can also be used to display a text at the top of, for example, MonoBehaviours or ScriptableObjects.")]
//public class MyScriptyScriptableObject : ScriptableObject
//{
//    public string MyText = ExampleHelper.GetString();
//    [TextArea(10, 15)]
//    public string Box;
//}


[OnInspectorInit]
private void CreateData()
{
    Scripty = ExampleHelper.GetScriptableObject<MyScriptyScriptableObject>("Scripty");
}

[OnInspectorDispose]
private void CleanupData()
{
    if (Scripty != null) UnityEngine.Object.DestroyImmediate(Scripty);
}