Exemplo n.º 1
0
        private void OnGUI()
        {
            if (_currentAction != null)
            {
                if (Event.current.type == EventType.keyDown && Event.current.keyCode == KeyCode.Return)
                {
                    if (!Application.isPlaying)
                    {
                        EditorSceneManager.MarkAllScenesDirty();
                    }
                    Close();
                }

                _currentAction.DrawEditorGui();

                if (!Application.isPlaying && GUILayout.Button("Save"))
                {
                    EditorSceneManager.MarkAllScenesDirty();
                }
            }
            else
            {
                GUILayout.Label("Select action");
            }
        }
Exemplo n.º 2
0
        private void OnGUI()
        {
            if (_currentAction != null)
            {
                if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Return)
                {
                    if (!Application.isPlaying)
                    {
                        EditorSceneManager.MarkAllScenesDirty();
                    }
                    //Close();
                    Repaint();
                }

                _currentAction.DrawEditorGui();

                GUIStyle savBt = new GUIStyle(GUI.skin.button)
                {
                    //normal = { background = _currentAction._changed ? EventAction.MakeTexSq("ff0000") : EventAction.MakeTexSq("666666") },
                    name = "Save"
                };

                if (!Application.isPlaying && GUILayout.Button("Save", savBt))
                {
                    EditorSceneManager.MarkAllScenesDirty();
                    //_currentAction._changed = false;
                }
            }
            else
            {
                GUILayout.Label("Select action");
            }
        }