Example #1
0
    private void TransitionToMainMenu()
    {
        tutorialUI.SetActive(true);
        waitingForTransition = false;
        buttonPromptABXY.gameObject.SetActive(true);
        SetMenuState(MenuState.MainMenu);

        LeaderboardDataManager leaderboardDataManager;

        if (LeaderboardDataManager.TryGetInstance(out leaderboardDataManager))
        {
            leaderboardDataManager.StopLastAddedAnimation();
        }
    }
Example #2
0
    private void Update()
    {
        if (player.GetButtonDown("DPadRight") || (player.GetAxis("Left Leg Horizontal") > kMenuDeadZone && player.GetAxisPrev("Left Leg Horizontal") <= kMenuDeadZone))
        {
            MoveLetterInput(1);
        }
        else if (player.GetButtonDown("DPadLeft") || (player.GetAxis("Left Leg Horizontal") < -kMenuDeadZone && player.GetAxisPrev("Left Leg Horizontal") >= -kMenuDeadZone))
        {
            MoveLetterInput(-1);
        }
        else if (player.GetButtonDown("Start Game"))
        {
            if (currentInputState == InputState.fourthLetter)
            {
                LeaderboardDataManager leaderboardDataManager;
                if (LeaderboardDataManager.TryGetInstance(out leaderboardDataManager))
                {
                    string condensedString = firstLetter.character.text + secondLetter.character.text + thirdLetter.character.text + fourthLetter.character.text;
                    string scoreString     = scoreText.text;
                    for (int i = 0; i < 4 - (scoreText.text.Length - 1); i++)
                    {
                        scoreString += "0";
                    }
                    leaderboardDataManager.AddHighScore(condensedString, scoreString);
                }

                IntegrityManager integrityManager;
                if (IntegrityManager.TryGetInstance(out integrityManager))
                {
                    LeaderboardPositionManager leaderboardPositionManager;
                    if (LeaderboardPositionManager.TryGetInstance(out leaderboardPositionManager))
                    {
                        leaderboardPositionManager.SetTargetLeaderboardPosition(leaderboardPositionManager.showAllPosition);
                    }

                    integrityManager.EndGame();
                    GameManager gameManager;
                    if (GameManager.TryGetInstance(out gameManager))
                    {
                        gameManager.OnFinishedEnteringHighScore();
                    }
                    gameObject.SetActive(false);
                }
            }
            else
            {
                MoveLetterInput(1);
            }
        }
    }