/// <summary> /// Destroys behavior tree instance /// </summary> public void RemoveBTInstance() { if (BTInstance != null && BTInstance.IsValid()) { RemoveTask(BTInstance.Root); } }
/// <summary> /// Loads behavior tree instance /// </summary> public void LoadBTInstance() { if (BehaviorTree != null && BehaviorTree.IsValid()) { BTInstance = MoonBT.CopyBT(BehaviorTree); } else { Debug.LogWarning("[MoonBehavior] " + name + ": Invalid BehaviorTree"); enabled = false; return; } }