예제 #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();
                    BehaviorTreeEditorUtility.UpdateComment <Service>(service);
                    BehaviorTreeEditor.RepaintAll();
                    AssetDatabase.SaveAssets();
                }
            }
            GUILayout.Space(7f);
            if (BehaviorTreeEditorUtility.DrawHeader("Service", false))
            {
                DrawTick();
            }
            BehaviorTreeEditorUtility.EndInspectorGUI(service);
        }
예제 #2
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();
                    BehaviorTreeEditorUtility.UpdateComment <Task>(task);
                    BehaviorTreeEditor.RepaintAll();
                    AssetDatabase.SaveAssets();
                }
            }
            BehaviorTreeEditorUtility.EndInspectorGUI(node);
        }
예제 #3
0
 private static void CheckWaitTask(Wait w)
 {
     if (w.tick <= 0)
     {
         w.tick = 1f;
         BehaviorTreeEditorUtility.UpdateComment <Wait>(w);
         _isChanged = true;
     }
 }
예제 #4
0
        private void DrawTick()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Space(7f);
            float tick = EditorGUILayout.FloatField("Tick", wait.tick);

            if (tick != wait.tick)
            {
                if (tick <= 0)
                {
                    tick = 0.1f;
                }
                wait.tick = tick;
                BehaviorTreeEditorUtility.UpdateComment <Wait>(wait);
                AssetDatabase.SaveAssets();
            }
            GUILayout.EndHorizontal();
        }
예제 #5
0
        private void DrawTick()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Space(7f);
            float tick = EditorGUILayout.FloatField("Interval", service.tick);

            if (tick != service.tick)
            {
                if (tick <= 0)
                {
                    tick = 0.1f;
                }
                service.tick = tick;
                BehaviorTreeEditorUtility.UpdateComment <Service>(service);
                BehaviorTreeEditor.RepaintAll();
                AssetDatabase.SaveAssets();
            }
            GUILayout.EndHorizontal();
        }
예제 #6
0
 protected void OnChanged()
 {
     BehaviorTreeEditorUtility.UpdateComment <Decorator>(decorator);
     BehaviorTreeEditor.RepaintAll();
     AssetDatabase.SaveAssets();
 }