private SubGame GetSubGameInstance(ESubGame type) { SubGame subGame = null; switch (type) { case ESubGame.SplashScreen: subGame = new Splash(); break; case ESubGame.Login: subGame = new Login(); break; case ESubGame.Match: subGame = new Match(); break; case ESubGame.Battle: subGame = new Battle(); break; case ESubGame.SelectLevel: subGame = new SelectLevel(); break; default: Debug.LogError("Unsupported SubGame Type!"); break; } return(subGame); }
virtual public void Destroy() { if (m_ui != null) { m_ui.Destroy(); } m_ui = null; m_subGame = null; }
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); } }
public void RestartBattle() { SubGame.RestartBattle(); }
public void NextLevel() { SubGame.NextLevel(); }
public void LeaveBattle() { SubGame.LeaveBattle(); }
public void OfflineMode() { SubGame.OfflineMode(); }
public void JoinRoom(string roomId) { SubGame.JoinRoom(roomId); }
public void SetSelectLevel(int levelNum) { SubGame.SetSelectLevel(levelNum); }
public void StartGame() { SubGame.StartGame(); }
public UIBridge(SubGame subGame, UIBase ui) { m_subGame = subGame; m_ui = ui; }
public void ResetServer() { SubGame.ResetServer(); }
public void OnlineMode() { SubGame.OnlineMode(); }