Esempio n. 1
0
        public bool Init()
        {
            NetworkMgr.Instance.SetMessageHandler(this);
            SwitchToSubgame(ESubGame.SplashScreen);

            TestScene.SetEnable(false);

            return(true);
        }
Esempio n. 2
0
        public void UpdateGame(float fDeltaTime)
        {
            // FPS temp code
            {
                ++m_fpsCount;
                m_fpsTimer += Time.deltaTime;
                if (m_fpsTimer >= 0.5f)
                {
                    TestScene.ShowLabel("FPS", (m_fpsCount / m_fpsTimer).ToString("f2"));
                    m_fpsCount = 0;
                    m_fpsTimer = 0f;
                }
            }

            // switch subgame
            if (m_newSubGameType != m_curSubGameType &&
                m_newSubGameType != ESubGame.None)
            {
                if (m_curSubGame != null)
                {
                    m_curSubGame.Destroy();
                    m_curSubGame = null;
                }

                m_curSubGame = GetSubGameInstance(m_newSubGameType);
                m_curSubGame.Init();
                m_curSubGameType = m_newSubGameType;
            }

            // update subgame
            if (m_curSubGame != null && !m_gamePause)
            {
                m_curSubGame.Update(fDeltaTime);
            }
            if (m_curSubGameType != ESubGame.SplashScreen)
            {
                NetworkMgr.Instance.Update(fDeltaTime);
                //EducationServer.Instance.Update(fDeltaTime);
                //AntiAddiction.Instance.Update(fDeltaTime);
            }
        }