Exemplo n.º 1
0
        /// <summary>
        /// This hanldes setting up the proper state based on the window's graph.
        /// </summary>
        internal void InitState()
        {
            // If the window has a valid graph and editable.
            if (_window.graph != null && _window.GetMode() == NodeEditorWindow.Mode.Edit)
            {
                string path = getCurrentGraphPath();

                // If the graph is temp.
                if (path.Contains(kTempGraphDirectory))
                {
                    SetState(SaveState.TempGraph);
                }

                // If the graph is saved (not a temp).
                else
                {
                    SetState(SaveState.SavedGraph);
                }
            }

            // Window is fresh, no graph yet set.
            else
            {
                SetState(SaveState.NoGraph);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Draw the window mode in the background.
        /// </summary>
        public void drawMode()
        {
            if (!graph)
            {
                GUI.Label(_modeStatusRect, new GUIContent("No Graph Set"), ModeStatusStyle);
            }

            else if (_window.GetMode() == NodeEditorWindow.Mode.Edit)
            {
                GUI.Label(_modeStatusRect, new GUIContent("Edit"), ModeStatusStyle);
            }

            else
            {
                GUI.Label(_modeStatusRect, new GUIContent("View"), ModeStatusStyle);
            }
        }