Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        _highScoreCanvas = GetComponentInChildren<Canvas>();
        PlayerNameInputText = _highScoreCanvas.GetComponentInChildren<InputField>();
        if(PlayerNameInputText != null)
        {
            Text[] inputTexts = PlayerNameInputText.gameObject.GetComponentsInChildren<Text>();
            foreach(Text t in inputTexts)
            {
                if (t.name == "Placeholder") t.text = UsersData.DEFAULT_NAME;
            }
        }

        Text[] texts = _highScoreCanvas.GetComponentsInChildren<Text>();
        foreach(Text t in texts)
        {
            t.fontSize = (int)(t.fontSize * ((Screen.width) / 1236f));

            if (t.name.Contains("Player Name")) RankPlayerNameText = t;
            else if(t.name.Contains("Scores")) RankScoreText = t;
        }

        obj_localHighScore = LocalHighScore.getInstance();
        obj_localHighScore.setMaxUser(maxNumOfUsers);
        minScore = obj_localHighScore.getMinScore();

        LoadScores();
    }