void OnGUI() { if (currentScreen.DrawBackground) { GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), BackgroundTexture); } currentScreen = currentScreen.Update(); }
public override void Update(GameTime gameTime) { keyboard.Update(); if (gameState == GameState.Menu) { menuScreen.Update(gameTime); } else if (gameState == GameState.Play) { gameScreen.Update(gameTime); } if (IsExiting) { this.Game.Exit(); } base.Update(gameTime); }
//---------------------------------------------------------------------- public virtual void Update(float _fElapsedTime) { MenuScreen.IsActive = Game.IsActive && (Game.GameStateMgr == null || !Game.GameStateMgr.IsSwitching) && mPopupStack.Count == 0; PopupScreen.IsActive = Game.IsActive && (Game.GameStateMgr == null || !Game.GameStateMgr.IsSwitching) && mPopupStack.Count > 0; MenuScreen.HandleInput(); if (mPopupStack.Count > 0) { PopupScreen.HandleInput(); } MenuScreen.Update(_fElapsedTime); if (mPopupStack.Count > 0) { PopupScreen.Update(_fElapsedTime); } }