Unity3d script that add callback to draw MGUI (without CustomEditor) in Inspector upon:
- on any Component Titlebar
- on GameObject Icon
- on Material title preview
[InitializeOnLoadMethod]
public static void Init()
{
ComponentTitlebarGUI.OnTitlebarGUI += TestGUI;
}
private static void TestGUI(Rect rect, Object target)
{
if (target is not MonoBehaviour) return;
GUI.Label(rect, EditorGUIUtility.IconContent("console.erroricon.sml"));
}