internal void ReloadObjects() { if (null != m_MapData) { //刷新场景逻辑 foreach (SceneLogicConfig cfg in m_MapData.m_SceneLogicMgr.GetData().Values) { SceneLogicInfo sli = m_SceneLogicInfoMgr.GetSceneLogicInfoByConfigId(cfg.GetId()); if (null == sli) { m_SceneLogicInfoMgr.AddSceneLogicInfo(cfg); } } //刷新npc foreach (Data_Unit unit in m_MapData.m_UnitMgr.GetData().Values) { if (unit.m_IsEnable) { NpcInfo npc = m_NpcMgr.GetNpcInfoByUnitId(unit.GetId()); if (null == npc) { m_NpcMgr.AddNpc(unit); } } } } }
private void RecycleSceneLogicInfo(SceneLogicInfo logicInfo) { if (null != logicInfo && m_UnusedSceneLogicInfos.Count < m_SceneLogicInfoPoolSize) { logicInfo.Reset(); m_UnusedSceneLogicInfos.Enqueue(logicInfo); } }
internal void OnSceneLogicSendStoryMessage(SceneLogicInfo info, string msgId, object[] args) { Scene scene = info.SceneContext.CustomData as Scene; if (null != scene) { scene.StorySystem.SendMessage(msgId, args); } }
public SceneLogicInfo AddSceneLogicInfo(int id, SceneLogicConfig cfg) { SceneLogicInfo info = NewSceneLogicInfo(id); info.SceneContext = m_SceneContext; info.SceneLogicConfig = cfg; m_SceneLogicInfos.Add(info.GetId(), info); return(info); }
public SceneLogicInfo DelayAddSceneLogicInfo(int id, SceneLogicConfig cfg) { SceneLogicInfo info = NewSceneLogicInfo(id); info.SceneContext = m_SceneContext; info.SceneLogicConfig = cfg; m_DelayAdd.Add(info); return(info); }
public SceneLogicInfo DelayAddSceneLogicInfo(int logicId) { SceneLogicInfo info = NewSceneLogicInfo(); info.SceneContext = m_SceneContext; info.SceneLogicConfig = new SceneLogicConfig(); info.SceneLogicConfig.m_LogicId = logicId; m_DelayAdd.Add(info); return(info); }
public SceneLogicInfo AddSceneLogicInfo(int logicId) { SceneLogicInfo info = NewSceneLogicInfo(); info.SceneContext = m_SceneContext; info.SceneLogicConfig = new SceneLogicConfig(); info.SceneLogicConfig.m_LogicId = logicId; m_SceneLogicInfos.Add(info.GetId(), info); return(info); }
public void RemoveSceneLogicInfo(int id) { SceneLogicInfo info = GetSceneLogicInfo(id); if (null != info) { m_SceneLogicInfos.Remove(id); info.SceneContext = null; RecycleSceneLogicInfo(info); } }
public SceneLogicInfo AddSceneLogicInfo(int id, int logicId) { SceneLogicInfo info = NewSceneLogicInfo(id); info.SceneContext = m_SceneContext; info.SceneLogicConfig = new SceneLogicConfig(); info.SceneLogicConfig.m_LogicId = logicId; if (m_SceneLogicInfos.Contains(id)) { SceneLogicInfo oldInfo = GetSceneLogicInfo(id); LogSystem.Error("AddSceneLogicInfo error, Id={0} was exist, LogicId={1}, NewLogicId={2}", id, oldInfo.LogicId, logicId); } m_SceneLogicInfos.Add(info.GetId(), info); return(info); }
public SceneLogicInfo GetSceneLogicInfoByConfigId(int id) { SceneLogicInfo ret = null; for (LinkedListNode <SceneLogicInfo> linkNode = m_SceneLogicInfos.FirstValue; null != linkNode; linkNode = linkNode.Next) { SceneLogicInfo info = linkNode.Value; if (info.ConfigId == id) { ret = info; break; } } return(ret); }
private SceneLogicInfo NewSceneLogicInfo(int id) { SceneLogicInfo info = null; if (m_UnusedSceneLogicInfos.Count > 0) { info = m_UnusedSceneLogicInfos.Dequeue(); info.Reset(); info.InitId(id); } else { info = new SceneLogicInfo(id); } return(info); }
public NpcInfo Boss(SceneLogicInfo info) { return(info.NpcManager.GetNpcInfo(BossId)); }
public NpcInfo ExplodeNpc(SceneLogicInfo info) { return(info.NpcManager.GetNpcInfo(npc_id_)); }
public NpcInfo Lair(SceneLogicInfo info) { return(info.NpcManager.GetNpcInfo(LairId)); }