public void ResetMemory(bool clearMemory = false) { if (m_behaviorTree == null) { return; } if (clearMemory) { ClearPathMemory(true); } CurrentTreeBotMemory.Clear(); ResetMemoryInternal(m_behaviorTree, CurrentTreeBotMemory); }
public void AssignBehaviorTree(MyBehaviorTree behaviorTree) { if (CurrentBehaviorTree == null || behaviorTree.BehaviorTreeId == CurrentBehaviorTree.BehaviorTreeId) { CurrentTreeBotMemory = CreateBehaviorTreeMemory(behaviorTree); } else { bool isValid = ValidateMemoryForBehavior(behaviorTree); if (!isValid) { CurrentTreeBotMemory.Clear(); ClearPathMemory(false); ResetMemoryInternal(behaviorTree, CurrentTreeBotMemory); } } }
public void ResetMemory(MyBehaviorTree behaviorTree, bool clearMemory = false) { if (clearMemory) { ClearPathMemory(true); } if (CurrentBehaviorTree.BehaviorTreeId == behaviorTree.BehaviorTreeId) { CurrentTreeBotMemory.Clear(); } else { CurrentTreeBotMemory = new MyPerTreeBotMemory(); } ResetMemoryInternal(behaviorTree, CurrentTreeBotMemory); }