public ISceneLogic GetSceneLogic(int id)
        {
            ISceneLogic logic = null;

            m_SceneLogics.TryGetValue(id, out logic);
            return(logic);
        }
Пример #2
0
        public void Tick()
        {
            if (0 == m_LastTickTime)
            {
                m_LastTickTime = TimeUtility.GetServerMilliseconds();
            }
            else
            {
                long delta = TimeUtility.GetServerMilliseconds() - m_LastTickTime;
                m_LastTickTime = TimeUtility.GetServerMilliseconds();
                for (LinkedListNode <SceneLogicInfo> node = m_SceneLogicInfoMgr.SceneLogicInfos.FirstValue; null != node; node = node.Next)
                {
                    SceneLogicInfo info = node.Value;
                    if (null != info)
                    {
                        ISceneLogic logic = SceneLogicManager.Instance.GetSceneLogic(info.LogicId);
                        if (null != logic)
                        {
                            logic.Execute(info, delta);
                        }
                        if (info.IsLogicFinished)
                        {
                            m_SceneLogicInfos.Add(info);
                        }
                    }
                }
                for (int i = 0; i < m_SceneLogicInfos.Count; i++)
                {
                    m_SceneLogicInfoMgr.RemoveSceneLogicInfo(m_SceneLogicInfos[i].GetId());
                }

                /*
                 * foreach (SceneLogicInfo info in m_SceneLogicInfos) {
                 * m_SceneLogicInfoMgr.RemoveSceneLogicInfo(info.GetId());
                 * }*/
                m_SceneLogicInfos.Clear();
                m_SceneLogicInfoMgr.ExecuteDelayAdd();
            }
        }