Example #1
0
 // Draw custom node inspector
 public override void DrawCustomInspector()
 {
     using (new GUILayout.VerticalScope(editorSkin.GetStyle("Box")))
     {
         GUILayout.Label("File Name:");
         fileName = GUILayout.TextField(fileName);
     }
     using (new GUILayout.VerticalScope(editorSkin.GetStyle("Box")))
     {
         GUILayout.Label("Save Path:");
         savePath = (FlowReactor.BlackboardSystem.BlackBoard.SavePath)EditorGUILayout.EnumPopup(savePath);
     }
     using (new GUILayout.VerticalScope(editorSkin.GetStyle("Box")))
     {
         GUILayout.Label("Format:");
         saveFormat = (FlowReactor.BlackboardSystem.BlackBoard.SaveFormat)EditorGUILayout.EnumPopup(saveFormat);
     }
     using (new GUILayout.VerticalScope(editorSkin.GetStyle("Box")))
     {
         availableBlackBoardsGuid = graphOwner.blackboards.Keys.Select(x => x.ToString()).ToArray();
         availableBlackBoards     = graphOwner.blackboards.Values.Select(x => x.blackboard != null ? x.blackboard.name.ToString() : "empty").ToArray();
         GUILayout.Label("BlackBoard:");
         selectedBlackBoard = EditorGUILayout.Popup(selectedBlackBoard, availableBlackBoards);
     }
 }
        // Draw custom node inspector
        public override void DrawCustomInspector()
        {
            using (new GUILayout.VerticalScope(editorSkin.GetStyle("Box")))
            {
                GUILayout.Label("File Name:");
                fileName = GUILayout.TextField(fileName);
            }
            using (new GUILayout.VerticalScope(editorSkin.GetStyle("Box")))
            {
                GUILayout.Label("Save Path:");
                loadPath = (FlowReactor.BlackboardSystem.BlackBoard.SavePath)EditorGUILayout.EnumPopup(loadPath);
            }
            using (new GUILayout.VerticalScope(editorSkin.GetStyle("Box")))
            {
                GUILayout.Label("Format:");
                loadFormat = (FlowReactor.BlackboardSystem.BlackBoard.SaveFormat)EditorGUILayout.EnumPopup(loadFormat);
            }

            EditorHelpers.DrawUILine();
            GUILayout.Label("Blackboards");

            if (GUILayout.Button("Add"))
            {
                blackboards.Add(null);
            }

            for (int b = 0; b < blackboards.Count; b++)
            {
                using (new GUILayout.HorizontalScope("Box"))
                {
                    if (blackboards[b] != null)
                    {
                        GUILayout.Label(blackboards[b].name);
                    }

                    blackboards[b] = (BlackBoard)EditorGUILayout.ObjectField(blackboards[b], typeof(BlackBoard), false);
                    if (GUILayout.Button("x"))
                    {
                        blackboards.RemoveAt(b);
                    }
                }
            }
        }