Пример #1
0
    public void DisplayHighScores()
    {
        GameOverPanel.SetActive(false);
        GameUI.SetActive(false);
        HighScoresPanel.SetActive(true);
        GameManager.Instance.UnpauseGame();

        for (int i = 0; i < GameManager.Instance.highScores.Count; i++)
        {
            ranks[i].enabled  = true;
            names[i].text     = GameManager.Instance.highScores[i].Name;
            names[i].enabled  = true;
            scores[i].text    = GameManager.Instance.highScores[i].Score.ToString();
            scores[i].enabled = true;
        }

        StartCoroutine(GameManager.Instance.QuitGame());
    }
Пример #2
0
    private void InitVariables()
    {
        Canvas canvas = FindObjectOfType <Canvas>();

        Text[] sceneText = canvas.GetComponentsInChildren <Text>();
        foreach (var text in sceneText)
        {
            if (text.name == "ScoreTypeText")
            {
                _scoreTypeText = text;
            }
            else if (text.name == "ScoreText")
            {
                _userScoreText = text;
            }
        }

        _highScoresPanel = canvas.GetComponentInChildren <HighScoresPanel>();
    }