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); }
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); }
private static void CheckWaitTask(Wait w) { if (w.tick <= 0) { w.tick = 1f; BehaviorTreeEditorUtility.UpdateComment <Wait>(w); _isChanged = true; } }
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(); }
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(); }
protected void OnChanged() { BehaviorTreeEditorUtility.UpdateComment <Decorator>(decorator); BehaviorTreeEditor.RepaintAll(); AssetDatabase.SaveAssets(); }