void SetSpatialConstraintEditorAsset(SpatialConstraintAsset spatialAsset, SpatialConstraintsEditorAssignmentState state)
        {
            if (spatailWindowState.initialized &&
                spatailWindowState.spatialAsset == spatialAsset &&
                spatailWindowState.assignmentState == state)
            {
                // The states are the same. no need to assign
                return;
            }

            spatailWindowState.initialized     = true;
            spatailWindowState.spatialAsset    = spatialAsset;
            spatailWindowState.assignmentState = state;

            var existingWindow = DungeonEditorHelper.GetWindowIfOpen <SpatialConstraintsEditorWindow>();

            // Open a window only if we are assigning
            if (state == SpatialConstraintsEditorAssignmentState.Assigned && existingWindow == null)
            {
                existingWindow = EditorWindow.GetWindow <SpatialConstraintsEditorWindow>();
            }

            if (existingWindow != null)
            {
                existingWindow.Init(spatialAsset, state);
            }
        }
Example #2
0
        protected override void OnGuiChanged()
        {
            var themeEditorWindow = DungeonEditorHelper.GetWindowIfOpen <DungeonThemeEditorWindow>();

            if (themeEditorWindow != null)
            {
                var graphEditor = themeEditorWindow.GraphEditor;
                graphEditor.HandleGraphStateChanged();
                graphEditor.HandleNodePropertyChanged(target as GraphNode);
            }
        }