// Use this for initialization void Start() { ws = WorldScript.getInstance(); score.text = ""; for (int i = 0; i < 5; i++) { score.text += ws.getName(i) + " : " + ws.getHighScore(i) + "\n"; } }
public void SaveScore() { if (input.text != "") { for (int i = 4; i > place; i--) { ws.setName(i, ws.getName(i - 1)); ws.setHighScore(i, ws.getHighScore(i - 1)); } ws.setName(place, input.text); ws.setHighScore(place, ws.GetScore()); SceneManager.LoadScene("Menu"); } }