示例#1
0
        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);
        }
示例#2
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);
        }
示例#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);
        }