Custom inspectors do not repaint properly

Issue #482 new
Tim Williams created an issue

The method detailed in the manual to create a custom inspector which uses Odin does not properly repaint lists and other animated elements on the inspector.

For example, if you have a field which is a custom class being drawn by your custom inspector, when expanding/collapsing the foldout for the class field the animation will freeze until you click on the inspector window again to force a repaint.

I have fixed the issue manually with the line added at the end of the below code.

public override void OnInspectorGUI()
        InspectorUtilities.BeginDrawPropertyTree(Tree, true);

        //Draw some properties...

        GUIHelper.CurrentWindow.RepaintIfRequested();    //This line allows the editor to repaint correctly for animations

It would be great if InspectorUtilities.EndDrawPropertyTree(); called RepaintIfRequested() automatically, so that users don't have to remember to call it themselves in every custom inspector.

Comments (0)

  1. Log in to comment