void Start() { anim = GetComponent <Animator> (); resumeButton = GameObject.Find("ResumeButton"); changeBtn = GameObject.Find("Resume").GetComponent <ChangeButtonText> (); finalScore = GameObject.Find("PauseScore").GetComponent <FinalScoreText> (); leaderboardScript = GetComponent <Leaderboard> (); UpdateUI(); }
private void AddText() { var scoreList = HighScore_Manager.instance().get_scores(); foreach (var item in scoreList) { GameObject newText = textObjectPool.GetObject(); newText.transform.SetParent(highContentPanel); FinalScoreText scoreText = newText.GetComponent <FinalScoreText>(); scoreText.Setup(item, this); //scoreText.GetComponent<RectTransform>(). scoreText.transform.localPosition = new Vector3(scoreText.transform.localPosition.x, scoreText.transform.localPosition.y, 0); scoreText.transform.localScale = new Vector3(1, 1, 1); } }