コード例 #1
0
        public override void OnInspectorGUI()
        {
            string name        = service.Name;
            string description = string.IsNullOrEmpty(service.comment) ? name : service.comment;

            BehaviorTreesEditorUtility.BeginInspectorGUI(ref name, ref description);
            if (name != service.Name)
            {
                service.Name = name;
                //AssetCreator.SaveAIAsset();
            }
            GUILayout.Space(7f);
            if (BehaviorTreesEditorUtility.DrawHeader("Target Code", false))
            {
                BehaviorTreesEditorUtility.DrawTargetScript(OnSelected, serializedObject);
                if (service.targetScript != null && BehaviorTreesEditorUtility.DrawTargetMethod(service.targetScript.GetType(), typeof(void), ref service.targetMethod))
                {
                    UpdateName();
                    UpdateComment();
                    BehaviorTreesEditor.RepaintAll();
                    AssetCreator.SaveAIAsset();
                    EditorGUILayout.Space();
                }
            }
            GUILayout.Space(7f);
            if (BehaviorTreesEditorUtility.DrawHeader("Service", false))
            {
                DrawTick();
            }
            BehaviorTreesEditorUtility.EndInspectorGUI(service);
        }
コード例 #2
0
ファイル: TaskInspector.cs プロジェクト: yabos/SaveTheQueen
        public override void OnInspectorGUI()
        {
            string name        = task.Name;
            string description = string.IsNullOrEmpty(node.description) ? name : node.description;

            BehaviorTreesEditorUtility.BeginInspectorGUI(ref name, ref description);
            if (name != task.Name)
            {
                task.Name        = name;
                task.description = description;
                //AssetCreator.SaveAIAsset();
            }
            GUILayout.Space(7f);
            if (BehaviorTreesEditorUtility.DrawHeader("Target Code", false))
            {
                BehaviorTreesEditorUtility.DrawTargetScript(OnSelected, serializedObject);
                if (task.targetScript != null && BehaviorTreesEditorUtility.DrawTargetMethod(task.targetScript.GetType(), typeof(eBTStatus), typeof(IEnumerator), ref task.targetMethod))
                {
                    CheckMethod();
                    UpdateName();
                    UpdateComment();
                    BehaviorTreesEditor.RepaintAll();
                    AssetCreator.SaveAIAsset();
                }
            }
            BehaviorTreesEditorUtility.EndInspectorGUI(node);
        }
コード例 #3
0
        public override void OnInspectorGUI()
        {
            string name        = decorator.Name;
            string description = string.IsNullOrEmpty(decorator.comment) ? name : decorator.comment;

            BehaviorTreesEditorUtility.BeginInspectorGUI(ref name, ref description);
            if (name != decorator.Name)
            {
                decorator.Name = name;
                //AssetCreator.SaveAIAsset();
            }
            GUILayout.Space(7f);
            if (BehaviorTreesEditorUtility.DrawHeader("Target Code", false))
            {
                BehaviorTreesEditorUtility.DrawTargetScript(OnSelected, serializedObject);
                if (decorator.targetScript != null && BehaviorTreesEditorUtility.DrawTargetMethod(decorator.targetScript.GetType(), typeof(bool), ref decorator.targetMethod))
                {
                    UpdateName("Decorator");
                    UpdateComment();
                    AssetCreator.SaveAIAsset();
                    EditorGUILayout.Space();
                }
            }
            GUILayout.Space(7f);
            if (BehaviorTreesEditorUtility.DrawHeader("Key Query", false))
            {
                DrawInverseCondition();
            }
            //GUILayout.Space(7f);
            //if (BehaviorTreesEditorUtility.DrawHeader("Observer Aborts", false))
            //{
            //    DrawTick();
            //}
            BehaviorTreesEditorUtility.EndInspectorGUI(decorator);
        }
コード例 #4
0
ファイル: NodeInspector.cs プロジェクト: yabos/SaveTheQueen
        public override void OnInspectorGUI()
        {
            string name        = node.Name;
            string description = string.IsNullOrEmpty(node.description) ? name : node.description;

            BehaviorTreesEditorUtility.BeginInspectorGUI(ref name, ref description);
            if (name != node.Name)
            {
                node.Name        = name;
                node.description = description;

                //AssetCreator.SaveAIAsset();
            }
            BehaviorTreesEditorUtility.EndInspectorGUI(node);
        }
コード例 #5
0
        public override void OnInspectorGUI()
        {
            string name        = wait.Name;
            string description = wait.description;

            BehaviorTreesEditorUtility.BeginInspectorGUI(ref name, ref description);
            if (name != wait.Name)
            {
                wait.Name        = name;
                wait.description = description;
                //AssetCreator.SaveAIAsset();
            }
            GUILayout.Space(7f);
            if (BehaviorTreesEditorUtility.DrawHeader("Wait Time", false))
            {
                DrawTick();
            }
            BehaviorTreesEditorUtility.EndInspectorGUI(node);
        }