Seneral / Node_Editor_Framework

A flexible and modular Node Editor Framework for creating node based displays and editors in Unity
https://nodeeditor.seneral.dev
MIT License
2.01k stars 415 forks source link

RTEditorGUI.EnumPopup #138

Closed AtheosCode closed 6 years ago

AtheosCode commented 6 years ago

when use panelType = (PanelType)RTEditorGUI.EnumPopup(panelType) in cutom node in Unity Play model

8w5 9p2 d gfw p jcoom76

And I change to EditorGUILayout.EnumPopup it is ok.

supplement: I think the problem is here, It retrurn a new GUIContent() every frame when Application isPlaying

    public static System.Enum EnumPopup (GUIContent label, System.Enum selected) 
    {
        #if UNITY_EDITOR
        if (!Application.isPlaying)
            return UnityEditor.EditorGUILayout.EnumPopup (label, selected);
        #endif
        label.text += ": " + selected.ToString ();
        GUILayout.Label (label);
        return selected;
    }
Seneral commented 6 years ago

Yep seen that before but forgot to fix it, thanks:)