예제 #1
0
        protected override void OnWindowGUI()
        {
            StratusEditorGUI.BeginAligned(TextAlignment.Center);
            this.mode = (Mode)GUILayout.Toolbar((int)this.mode, this.toolbarOptions, GUILayout.ExpandWidth(false));
            StratusEditorGUI.EndAligned();

            GUILayout.Space(padding);
            switch (this.mode)
            {
            case Mode.Editor:
                this.DrawEditor();
                break;

            case Mode.Debugger:
                this.DrawDebugger();
                break;
            }
        }
예제 #2
0
        private void DrawBlackboard(Rect rect)
        {
            GUILayout.BeginArea(rect);
            GUILayout.Label("Blackboard", StratusGUIStyles.header);
            {
                // Set the blackboard
                SerializedProperty blackboardProperty = this.behaviorTreeProperties.GetProperty(nameof(BehaviorTree.blackboard));
                bool changed = this.InspectProperty(blackboardProperty, "Asset");
                if (changed && this.blackboard != null)
                {
                    this.OnBlackboardSet();
                }

                EditorGUILayout.Space();

                // Draw the blackboard
                if (this.blackboardEditor != null)
                {
                    // Controls
                    StratusEditorGUI.BeginAligned(TextAlignment.Center);
                    StratusEditorGUI.EnumToolbar(ref this.scope);
                    StratusEditorGUI.EndAligned();

                    this.blackboardScrollPosition = EditorGUILayout.BeginScrollView(this.blackboardScrollPosition, GUI.skin.box);
                    switch (this.scope)
                    {
                    case StratusBlackboard.Scope.Local:
                        this.blackboardEditor.DrawSerializedProperty(nameof(StratusBlackboard.locals));
                        break;

                    case StratusBlackboard.Scope.Global:
                        this.blackboardEditor.DrawSerializedProperty(nameof(StratusBlackboard.globals));
                        break;
                    }
                    EditorGUILayout.EndScrollView();
                }
            }
            GUILayout.EndArea();
        }