Exemplo n.º 1
0
 private void HidePauseMenu()
 {
     PlayerNumber = -1;
     gameObject.SetActive(false);
     PlayerComponentsEnabler.EnableOrDisableAllPlayersInputResponses(true);
     Time.timeScale = 1f;
 }
Exemplo n.º 2
0
 private void ShowPauseMenu()
 {
     PlayerIndicatorIcon.color = PlayerColor;
     gameObject.SetActive(true);
     PlayerComponentsEnabler.EnableOrDisableAllPlayersInputResponses(false);
     Time.timeScale = 0f;
 }
Exemplo n.º 3
0
        public bool HandleEvent(AFEvent afEvent)
        {
            switch (afEvent.type)
            {
            case AFEventType.PLAYERS_ALL_CREATED: {
                PlayerComponentsEnabler.EnableOrDisableAllPlayersInputResponses(false);
                Debug.Log("Delaying player input start");
                Invoke("ReEnableAllPlayersInputResponses", PlayersState.INSTANCE.WaitTimeForPlayersToStart);
                if (!hasCalledNotifyGameCanStart)
                {
                    hasCalledNotifyGameCanStart = true;
                    Invoke("NotifyGameCanStart", PlayersState.INSTANCE.WaitTimeForPlayersToStart);
                }
                isAwaiting = true;
                break;
            }

            case AFEventType.GAME_OVER: {
                PlayerComponentsEnabler.EnableOrDisableAllPlayersInputResponses(false);
                //TODO: Move the score to the center of the screen
                Invoke("LoadGameOverScene", PlayersState.INSTANCE.WaitTimeToDisplayGameOver);
                break;
            }

            case AFEventType.ROUND_OVER:
            {
                PlayerComponentsEnabler.EnableOrDisableAllPlayersInputResponses(false);
                Invoke("LoadRoundOverScene", PlayersState.INSTANCE.WaitTimeToDisplayGameOver);
                break;
            }
            }
            return(false);
        }
Exemplo n.º 4
0
 private void QuitGame()
 {
     PlayerComponentsEnabler.EnableOrDisableAllPlayersInputResponses(true);
     Time.timeScale = 1f;
     AFEventManager.INSTANCE.RemoveAllListeners();
     PlayersState.INSTANCE.Reset();
     SceneManager.LoadScene(SceneNames.GAME_MODE_SELECTION);
 }
Exemplo n.º 5
0
 void ReEnableAllPlayersInputResponses()
 {
     isAwaiting = false;
     PlayerComponentsEnabler.EnableOrDisableAllPlayersInputResponses(true);
     Debug.Log("Player input is now processed");
 }