public void Reset(BehaviorTreeData behaviorTreeData, BehaviorTreeEntity behaviorTreeEntity)
 {
     BehaviorDataController.Instance.BehaviorTreeData = behaviorTreeData;
     _behaviorTreeEntity = behaviorTreeEntity;
     BehaviorTreeEntity.CurrentDebugEntityId = _behaviorTreeEntity.EntityId;
     SetRunTimeDrawNode(behaviorTreeEntity);
     BehaviorDataController.Instance.PlayState = BehaviorPlayType.PLAY;
     NodeNotify.Clear();
 }
示例#2
0
 public void Reset(BehaviorTreeData behaviorTreeData, BehaviorTreeEntity behaviorTreeEntity)
 {
     BehaviorManager.Instance.BehaviorTreeData = behaviorTreeData;
     _behaviorTreeEntity = behaviorTreeEntity;
     BehaviorTreeEntity.CurrentDebugEntityId = _behaviorTreeEntity.EntityId;
     SetRunTimeDrawNode(behaviorTreeEntity);
     BehaviorManager.behaviorRuntimePlay(BehaviorPlayType.PLAY);
     NodeNotify.Clear();
 }
 private void SetRunTimeDrawNode(BehaviorTreeEntity behaviorTreeEntity)
 {
     if (!Application.isPlaying || !Application.isEditor)
     {
         return;
     }
     BehaviorDataController.Instance.RunTimeInvalidSubTreeHash.Clear();
     foreach (var nodeId in behaviorTreeEntity.InvalidSubTreeList)
     {
         BehaviorDataController.Instance.RunTimeInvalidSubTreeHash.Add(nodeId);
     }
 }
示例#4
0
        public void Reset(BehaviorTreeData behaviorTreeData)
        {
            behaviorTreeData.nodeDic.Clear();
            for (int i = 0; i < behaviorTreeData.nodeList.Count; ++i)
            {
                NodeValue nodeValue = behaviorTreeData.nodeList[i];
                behaviorTreeData.nodeDic.Add(nodeValue.id, nodeValue);
            }

            _behaviorTreeEntity = new BehaviorTreeEntity(long.MaxValue, behaviorTreeData, LoadConfig);
            BehaviorTreeEntity.CurrentDebugEntityId = _behaviorTreeEntity.EntityId;
            SetRunTimeDrawNode(_behaviorTreeEntity);
            NodeNotify.Clear();
        }
        public void Reset(BehaviorTreeData behaviorTreeData)
        {
            behaviorTreeData.nodeDic.Clear();
            for (int i = 0; i < behaviorTreeData.nodeList.Count; ++i)
            {
                NodeValue nodeValue = behaviorTreeData.nodeList[i];
                int       index     = EnumNames.GetEnumIndex <NODE_TYPE>((NODE_TYPE)nodeValue.NodeType);
                nodeValue.nodeName = EnumNames.GetEnumName <NODE_TYPE>(index);
                behaviorTreeData.nodeDic.Add(nodeValue.id, nodeValue);
            }

            BehaviorAnalysis.GetInstance().SetLoadConfigEvent(LoadConfig);
            _behaviorTreeEntity = new BehaviorTreeEntity(long.MaxValue, behaviorTreeData);
            BehaviorTreeEntity.CurrentDebugEntityId = _behaviorTreeEntity.EntityId;
            SetRunTimeDrawNode(_behaviorTreeEntity);
            NodeNotify.Clear();
        }
示例#6
0
 public void Reset(BehaviorTreeData behaviorTreeData)
 {
     _behaviorTreeEntity = new BehaviorTreeEntity(behaviorTreeData);
 }