예제 #1
0
        public void ShowUI(uint eLayoutType, uint eLogicModuleIndex)
        {
            if (m_uiDisactiveList.Contains(eLogicModuleIndex))
            {
                m_uiDisactiveList.Remove(eLogicModuleIndex);
            }

            uint curActiveMoudleIndex;

            if (m_uiActiveDict.TryGetValue(eLayoutType, out curActiveMoudleIndex))
            {
                if (curActiveMoudleIndex == eLogicModuleIndex)
                {
                    return;
                }
                // 隐藏逻辑界面
                LogicModule module = LogicModuleManager.Inst.GetLogicModule(curActiveMoudleIndex);
                if (null != module)
                {
                    module.SetVisible(false);
                }
                m_uiActiveDict[eLayoutType] = eLogicModuleIndex;
            }
            else
            {
                m_uiActiveDict.Add(eLayoutType, eLogicModuleIndex);
            }
        }
예제 #2
0
        public LogicModule GetLogicModule(uint eLogicModuleIndex)
        {
            LogicModule module = null;

            if (m_dicLoginCreateModules.TryGetValue(eLogicModuleIndex, out module))
            {
                return(module);
            }
            if (m_dicGameCreateModules.TryGetValue(eLogicModuleIndex, out module))
            {
                return(module);
            }
            return(null);
        }
예제 #3
0
        public T GetLogicModule <T>(uint eLogicModuleIndex) where T : LogicModule
        {
            LogicModule module = null;

            if (m_dicLoginCreateModules.TryGetValue(eLogicModuleIndex, out module))
            {
                return((T)module);
            }
            if (m_dicGameCreateModules.TryGetValue(eLogicModuleIndex, out module))
            {
                return((T)module);
            }
            return(null);
        }
예제 #4
0
        public void DestroyLogicModules()
        {
            var loginItem = m_dicLoginCreateModules.GetEnumerator();

            try
            {
                while (loginItem.MoveNext())
                {
                    LogicModule module = loginItem.Current.Value as LogicModule;
                    if (null != module)
                    {
                        module.UnInit();
                    }
                }
            }
            catch (System.Exception e)
            {
                Debug.LogException(e);
            }
            m_dicLoginCreateModules.Clear();
            m_dicLoginCreateModules = null;

            var gameItem = m_dicGameCreateModules.GetEnumerator();

            try
            {
                while (gameItem.MoveNext())
                {
                    LogicModule module = gameItem.Current.Value as LogicModule;
                    if (null != module)
                    {
                        module.UnInit();
                    }
                }
            }
            catch (System.Exception e)
            {
                Debug.LogException(e);
            }
            m_dicGameCreateModules.Clear();
            m_dicGameCreateModules = null;
        }
예제 #5
0
 public override void SingletonUpdate(float fTime, float fDTime)
 {
     if (S_GlobalConfig.m_eGameState == E_GlobalGameState.Login ||
         S_GlobalConfig.m_eGameState == E_GlobalGameState.Select)
     {
         var item = m_dicLoginCreateModules.GetEnumerator();
         try
         {
             while (item.MoveNext())
             {
                 LogicModule module = item.Current.Value as LogicModule;
                 if (null != module)
                 {
                     module.Update(fTime, fDTime);
                 }
             }
         }
         catch (System.Exception e)
         {
             Debug.LogException(e);
         }
     }
     else if (S_GlobalConfig.m_eGameState == E_GlobalGameState.Game)
     {
         var item = m_dicGameCreateModules.GetEnumerator();
         try
         {
             while (item.MoveNext())
             {
                 LogicModule module = item.Current.Value as LogicModule;
                 if (null != module)
                 {
                     module.Update(fTime, fDTime);
                 }
             }
         }
         catch (System.Exception e)
         {
             Debug.LogException(e);
         }
     }
 }
예제 #6
0
        public void InitGameModules()
        {
            var item = m_dicLoginCreateModules.GetEnumerator();

            try
            {
                while (item.MoveNext())
                {
                    LogicModule module = item.Current.Value as LogicModule;
                    if (null != module)
                    {
                        module.Init();
                    }
                }
            }
            catch (System.Exception e)
            {
                Debug.LogException(e);
            }
        }