void Awake() { if (!_instance) { _instance = this; } }
private void _SetFinalScore() { _finalScore = UIController.instance.gameOverMenu.transform.Find("Panel").transform.Find("FinalScore").gameObject.GetComponent <Text> (); _finalScore.text += (int)((UIController.instance.GetCoinsCollected() * 5) + Time.timeSinceLevelLoad); HighScore_Manager high = HighScore_Manager.instance(); high.addScore((int)((UIController.instance.GetCoinsCollected() * 5) + Time.timeSinceLevelLoad), UIController.runs, UIController.instance.GetCoins(), Time.timeSinceLevelLoad); high.save(); }
//Start void Start() { me = gameObject.GetComponent <HighScore_Manager>(); scores = new List <ScoreData>(); for (int i = 0; i < slots; i++) { scores.Add(new ScoreData()); } sortList(); load(); }
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); } }