//public string[] highScoresNames = new string[3]; private void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } highScores[0] = 5000; //highScoresNames[0] = "CODY"; highScores[1] = 3000; //highScoresNames[0] = "GOD"; highScores[2] = 1000; //highScoresNames[0] = "BOB"; }
private void Start() { Scoreholder currentScore = FindObjectOfType <Scoreholder>(); if (currentScore.score > currentScore.highScores[0]) { currentScore.highScores[2] = currentScore.highScores[1]; //currentScore.highScoresNames[2] = currentScore.highScoresNames[1]; currentScore.highScores[1] = currentScore.highScores[0]; //currentScore.highScoresNames[1] = currentScore.highScoresNames[0]; currentScore.highScores[0] = currentScore.score; } else if (currentScore.score > currentScore.highScores[1]) { currentScore.highScores[2] = currentScore.highScores[1]; //currentScore.highScoresNames[2] = currentScore.highScoresNames[1]; currentScore.highScores[1] = currentScore.score; } else if (currentScore.score > currentScore.highScores[2]) { currentScore.highScores[2] = currentScore.score; } }
private void Start() { total = FindObjectOfType <Scoreholder>(); }
// Use this for initialization void Start() { tim = FindObjectOfType <Scoreholder>(); ending.text = tim.score.ToString(); }