Пример #1
0
        public override void OnInspectorGUI()
        {
            string name = service.Name;

            BehaviorTreeEditorUtility.BeginInspectorGUI(ref name);
            if (name != service.Name)
            {
                service.Name = name;
                AssetDatabase.SaveAssets();
            }
            GUILayout.Space(7f);
            if (BehaviorTreeEditorUtility.DrawHeader("Target Code", false))
            {
                BehaviorTreeEditorUtility.DrawTargetScript(OnSelected, serializedObject);
                if (service.targetScript != null && BehaviorTreeEditorUtility.DrawTargetMethod(service.targetScript.GetType(), typeof(void), ref service.targetMethod))
                {
                    UpdateName();
                    UpdateComment();
                    BehaviorTreeEditor.RepaintAll();
                    AssetDatabase.SaveAssets();
                    EditorGUILayout.Space();
                }
            }
            GUILayout.Space(7f);
            if (BehaviorTreeEditorUtility.DrawHeader("Service", false))
            {
                DrawTick();
            }
            BehaviorTreeEditorUtility.EndInspectorGUI(service);
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            string name = decorator.Name;

            BehaviorTreeEditorUtility.BeginInspectorGUI(ref name);
            if (name != decorator.Name)
            {
                decorator.Name = name;
                AssetDatabase.SaveAssets();
            }
            GUILayout.Space(7f);
            if (BehaviorTreeEditorUtility.DrawHeader("Target Code", false))
            {
                BehaviorTreeEditorUtility.DrawTargetScript(OnSelected, serializedObject);
                if (decorator.targetScript != null && BehaviorTreeEditorUtility.DrawTargetMethod(decorator.targetScript.GetType(), typeof(bool), ref decorator.targetMethod))
                {
                    UpdateName();
                    OnChanged();
                }
            }
            GUILayout.Space(7f);
            if (BehaviorTreeEditorUtility.DrawHeader("Key Query", false))
            {
                DrawInverseCondition();
            }
            GUILayout.Space(7f);
            if (BehaviorTreeEditorUtility.DrawHeader("Observer Aborts", false))
            {
                DrawTick();
            }
            BehaviorTreeEditorUtility.EndInspectorGUI(decorator);
        }
Пример #3
0
        public override void OnInspectorGUI()
        {
            string name = task.Name;

            BehaviorTreeEditorUtility.BeginInspectorGUI(ref name);
            if (name != task.Name)
            {
                task.Name = name;
                AssetDatabase.SaveAssets();
            }
            GUILayout.Space(7f);
            if (BehaviorTreeEditorUtility.DrawHeader("Target Code", false))
            {
                BehaviorTreeEditorUtility.DrawTargetScript(OnSelected, serializedObject);
                if (task.targetScript != null && BehaviorTreeEditorUtility.DrawTargetMethod(task.targetScript.GetType(), typeof(System.IDisposable), typeof(IEnumerator), ref task.targetMethod))
                {
                    CheckMethod();
                    UpdateName();
                    UpdateComment();
                    BehaviorTreeEditor.RepaintAll();
                    AssetDatabase.SaveAssets();
                }
            }
            BehaviorTreeEditorUtility.EndInspectorGUI(node);
        }
Пример #4
0
        public override void OnInspectorGUI()
        {
            string name = wait.Name;

            BehaviorTreeEditorUtility.BeginInspectorGUI(ref name);
            if (name != wait.Name)
            {
                wait.Name = name;
                AssetDatabase.SaveAssets();
            }
            GUILayout.Space(7f);
            if (BehaviorTreeEditorUtility.DrawHeader("Wait Time", false))
            {
                DrawTick();
            }
            BehaviorTreeEditorUtility.EndInspectorGUI(node);
        }