Feature Request - Odin icon in inspectors to let you know the inspector is being rendered by Odin

Issue #710 new
Riley George created an issue

Currently, the only way to know if an inspector is to either:

  1. Add some Odin element to it and check that it shows up
  2. Check the Editor Types tab of the Odin prefs

It would be helpful for debugging purposes if Odin displayed an icon in inspectors it renders so we could quickly see at a glance if Odin is working for a particular type.

Comments (1)

  1. Antonio Rafael Antunes Miranda

    Something like that can be implemented very easily. You could, for example, create a generic value drawer and give it a high priority.
    (9999 is a good one since it’s pretty high but still less than the ShowDrawerChain’s priority which should always have the highest priority)

    That value drawer will then be the highest priority drawer for every inspector that’s drawn with Odin and you can draw an Icon or whatever you want to show that this object is drawn by Odin.

    [DrawerPriority(9999, 0, 0)]
    public class OdinDebugDrawer<T> : OdinValueDrawer<T>
    {
        // Make sure that this drawer only targets the tree root and not every single value in the inspector
        protected override bool CanDrawValueProperty(InspectorProperty property)
        {
            return property.IsTreeRoot;
        }
    
        protected override void Initialize()
        {
            // Initialize your stuff, for example you could grab an icon here.
            // [...]
        }
    
        protected override void DrawPropertyLayout(GUIContent label)
        {
            // Draw something at the begining of every inspector drawn by Odin.
            // [...]
    
            // Call the next drawer / draw the property like it would without this drawer.
            CallNextDrawer(label);
    
            // Draw something at the end of every inspector drawn by Odin.
            // [...]
        }
    }
    

  2. Log in to comment