Enum in property tree doesnt fold out when pressing(stays on 0)

Issue #431 new
Simon Engelbrecht created an issue
  1. Created a property tree in an editor window, with a propertytree being drawn in a gui.window. the rest of the serialized values work fine, but the enum one does not do anything when clicking it. it jsut stays on the 0th value.

  2. Create OdinEditorWindow in a gui window(probably not related to the issue), in the window method make a propertytree that is created from a ScriptableObject. In the ScriptableObject, have a serialized enum; call PropertyTree.GetPropertyAtPath("enumfield").Draw(); observe how clicking the enum wont do anything?

My code: In EditorWindow script:

protected override void OnGUI()
        {
            base.OnGUI();
            if(containerSO == null)
            {
                return;
            }
            BeginWindows();
            for (int i = 0; i < loopWindows.Count; i++)
            {
                loopWindows[i].Rect = GUI.Window(i, loopWindows[i].Rect , DrawNodeWindow, "Window " + i);

            }
            EndWindows();
            this.RepaintIfRequested();
        }

        private void DrawNodeWindow(int id)
        {

            InspectorUtilities.BeginDrawPropertyTree(loopWindows[id].PropertyTree, true); 

            loopWindows[id].PropertyTree.GetPropertyAtPath("states").Draw();
            loopWindows[id].PropertyTree.GetPropertyAtPath("priority").Draw();
            loopWindows[id].PropertyTree.GetPropertyAtPath("conditions").Draw(); // this is the list of "condition classes"

            InspectorUtilities.EndDrawPropertyTree(loopWindows[id].PropertyTree);

            this.RepaintIfRequested();

            GUI.DragWindow();
        }

In the ScriptableObject, list of "condition classes"

        [TableList]
        [SerializeField]
        private List<StateLoopCondition> conditions = new List<StateLoopCondition>();

And in the condition class with the enum

 [System.Serializable]
    public class StateLoopCondition
    {
        [SerializeField]
        public enum Condition
        {
            Health = 0,
            Time = 1,
            Test = 2
        };

        [TableColumnWidth(100)]
        [SerializeField]
        private Condition condition; // this is the enum that is drawn but doesnt do anything when clicked.

It should noted that changing the values in the ScriptableObject itself works fine and reflects in the editor window.

3. Screenshot_1.png the left is the editor window and the right is the same values in the scriptable object where the enum can be clicked and a drop down appears 4. Using Unity 2018.2.6f1

5 Odin 2.0.5

  1. Editor Only mode is disabled

  2. Windows 10

Comments (0)

  1. Log in to comment