예제 #1
0
        private void HandleGameStateUpdatedEvent(object invoker, System.EventArgs e)
        {
            GameStateUpdatedEventArgs args = (GameStateUpdatedEventArgs)e;

            // If state changed to pause, open pause canvas
            if (args.NewState == GameManager.GameState.PAUSED)
            {
                _pauseMenu.gameObject.SetActive(true);
                Debug.Log("UIManager.HandleGameStateUpdatedEvent: Opening pause canvas.");
            }
            // If state changed from pause, close pause canvas
            else if (args.PrevState == GameManager.GameState.PAUSED)
            {
                _pauseMenu.gameObject.SetActive(false);
                Debug.Log("UIManager.HandleGameStateUpdatedEvent: Closing pause canvas.");
            }
            // If state changed to pregame, open main menu canvas
            else if (args.NewState == GameManager.GameState.PREGAME)
            {
                _mainMenu.gameObject.SetActive(true);
            }
            else if (args.NewState == GameManager.GameState.RUNNING)
            {
                _hud.gameObject.SetActive(true);
                _loadingScreen.gameObject.SetActive(false);
            }
            else if (args.NewState == GameManager.GameState.LOADING)
            {
                _loadingScreen.gameObject.SetActive(true);
            }
        }
예제 #2
0
        private void HandleGameStateUpdatedEvent(object invoker, System.EventArgs e)
        {
            GameStateUpdatedEventArgs args = (GameStateUpdatedEventArgs)e;

            if (args.NewState == GameManager.GameState.PAUSED)
            {
                // TODO update audio when game paused
            }
        }
예제 #3
0
        private void HandleGameStateUpdatedEvent(object invoker, System.EventArgs e)
        {
            GameStateUpdatedEventArgs args = (GameStateUpdatedEventArgs)e;

            // If leaving pregame to running, fade out
            if (args.PrevState == GameManager.GameState.PREGAME && args.NewState == GameManager.GameState.RUNNING)
            {
                FadeOut();
                Debug.Log("MainMenu.HandleGameStateUpdatedEvent: Fading out.");
            }
        }
예제 #4
0
        private void HandleGameStateUpdatedEvent(object invoker, System.EventArgs e)
        {
            GameStateUpdatedEventArgs args = (GameStateUpdatedEventArgs)e;

            if (args.PrevState == GameManager.GameState.PAUSED || args.PrevState == GameManager.GameState.DIALOGUE)
            {
                UndoLeaderControlChange();
                Debug.Log("PlayerManager.HandleGameStateUpdatedEvent: Reverting pause leader control change.");
            }
            else if (args.NewState == GameManager.GameState.PAUSED || args.NewState == GameManager.GameState.DIALOGUE)
            {
                LeaderControlChange(args.Initiator, ActionMapName.UI);
                Debug.Log("PlayerManager.HandleGameStateUpdatedEvent: Performing UI leader control change.");
            }
        }
        private void HandleGameStateUpdatedEvent(object invoker, System.EventArgs e)
        {
            GameStateUpdatedEventArgs args = (GameStateUpdatedEventArgs)e;

            if (args.PrevState == GameManager.GameState.DIALOGUE)
            {
                Debug.Log("LARSGameSession.HandleGameStateUpdatedEvent: Making players vulnerable.");
                MakePlayersVulnerable();
            }
            else if (args.NewState == GameManager.GameState.DIALOGUE)
            {
                Debug.Log("LARSGameSession.HandleGameStateUpdatedEvent: Making players invulnerable.");
                MakePlayersInvulnerable();
            }
        }