public void CreateBehaviorTree(BaseEntity entity, string path, bool enable = false) { BehaviorTree tree = BehaviorTreeFactory.CreateBehaviorTree(entity, path); if (_tree.ContainsKey(entity)) { LogUtil.LogUtility.PrintWarning(string.Format("[BehaviorTreeMgr]repeat add BehaviorTree at EntityName: {0}.", entity.EntityName)); } tree.Enable = enable; _tree[entity] = tree; }
public void CreateBehaviorTree(AbsEntity entity, string path, bool enable = false) { BehaviorTree tree = BehaviorTreeFactory.CreateBehaviorTree(entity, path); if (entity == null) { LogHelper.PrintError("[BehaviorTreeMgr]Create BehaviorTree error,entity is null!"); return; } if (_treeDict.ContainsKey(entity)) { LogHelper.PrintWarning(string.Format("[BehaviorTreeMgr]repeat add BehaviorTree at EntityName: {0}.", entity.EntityName)); } tree.Enable = enable; _treeDict[entity] = tree; }