public NEData GetSkillData(int remoteId) { NEData neData = m_cNEDataLoader.Get(remoteId); if (neData == null) { CLog.LogError("can not find remoteId = " + remoteId + " cfgs!"); } return(neData); }
public Skill(AgentObject host, NEData neData) { Init(); m_cHost = host; m_cNEData = neData; m_cSkillData = m_cNEData.data as SkillData; m_cSkillTree = CreateNode(m_cNEData) as SkillTree; m_cSkillTree.Clear(); m_cBlackBoard = new SkillBlackBoard(this); m_bIsDo = false; m_sStartTime = -1000; }
public RemoteTree GetRemoteTree(int configId) { Queue <RemoteTree> queue = null; if (m_dicPool.TryGetValue(configId, out queue)) { if (queue.Count > 0) { return(queue.Dequeue()); } } NEData neData = RemoteCfgSys.Instance.GetSkillData(configId); RemoteTree remoteTree = CreateNode(neData) as RemoteTree; return(remoteTree); }
public void AddSkill(int skillId) { if (GetSkill(skillId) != null) { CLog.LogError("skillId = " + skillId + " is exist!"); return; } NEData neData = SkillCfgSys.Instance.GetSkillData(skillId); if (neData == null) { return; } Skill skill = new Skill(m_cAgentObject, neData); m_lstSkill.Add(skill); }
public static BTNode CreateNode(NEData neData) { Type neDataType = neData.data.GetType(); int index = Remote.lstRemoteNodeDataType.IndexOf(neDataType); if (index == -1) { CLog.LogError("can not find remoteNeDataType=" + neDataType + " mapping nodeType"); return(null); } Type neNodeType = Remote.lstRemoteNodeType[index]; BTNode neNode = Activator.CreateInstance(neNodeType) as BTNode; neNode.data = neData.data; if (neData.lstChild != null) { for (int i = 0; i < neData.lstChild.Count; i++) { BTNode childNode = CreateNode(neData.lstChild[i]); neNode.AddChild(childNode); } } return(neNode); }
public virtual NEData GetData() { if (m_cData == null) { Debug.LogError(this.GetType() + " m_cData == null,need initialize!"); return(null); } NEData neData = new NEData(); neData.data = m_cData; if (m_lstChild != null && m_lstChild.Count > 0) { neData.lstChild = new List <NEData>(); for (int i = 0; i < m_lstChild.Count; i++) { NEData data = m_lstChild[i].GetData(); if (data != null) { neData.lstChild.Add(data); } } } return(neData); }