示例#1
0
    private void State_GameOver()
    {
        // show the game over text
        gameOverView.ShowView();

        // after a short delay, proceed with the game
        helper.InvokeActionDelayed(ChangeToNextState, gameOverShowDuration);
    }
示例#2
0
    private void State_GameStart()
    {
        // ensure that the score and lives views are visible
        scoreView.ShowView();
        livesView.ShowView();

        // listen out for when the game ends, so we can proceed
        GameController.GameOver += GameController_GameOver;
    }
示例#3
0
 private void GameController_GamePaused()
 {
     if (gamePausedView.State == VisibilityStates.Hidden)
     {
         gamePausedView.ShowView();
     }
     else
     {
         gamePausedView.HideView();
     }
 }
示例#4
0
    private void State_EnterPlayerName()
    {
        // renable the cursor for clicking
        Cursor.visible = true;

        // hide the game over text view
        gameOverView.HideView();

        // show the views responsible for collecting the players name
        enterNameView.ShowView();
        playerNameView.ShowView();
        acceptNameView.ShowView();

        // start the text capture coroutine so the player can enter their name
        StartCoroutine(collectInputEnumerator = CollectInputCoroutine());

        // add a listener so we know if the button has been clicked
        playerNameAcceptButton.onClick.AddListener(PlayerNameButtonClicked);
    }