// Use this for initialization void Start() { length = LankDB.GetInstance().getMaxLank(); LankingScore = new int[length]; StartCoroutine(showRanking()); }
void showLank() { LankingScore = LankDB.GetInstance().loadLanking(); Array.Sort(LankingScore); Array.Reverse(LankingScore); int score = Int32.Parse(nowScore.text.ToString()); if (score > LankingScore[9]) { int[] array = new int[11]; for (int i = 0; i < 10; i++) { array[i] = LankingScore[i]; } array[10] = score; Array.Sort(array); Array.Reverse(array); for (int i = 0; i < 10; i++) { LankingScore[i] = array[i]; } LankDB.GetInstance().saveAllLank(LankingScore); } else { } if (gameOverToLeaderBoard.gameObject.activeSelf) { lank1.text = LankingScore[0].ToString(); lank2.text = LankingScore[1].ToString(); lank3.text = LankingScore[2].ToString(); lank4.text = LankingScore[3].ToString(); lank5.text = LankingScore[4].ToString(); lank6.text = LankingScore[5].ToString(); lank7.text = LankingScore[6].ToString(); lank8.text = LankingScore[7].ToString(); lank9.text = LankingScore[8].ToString(); lank10.text = LankingScore[9].ToString(); } else { for (int i = 0; i < 10; i++) { mainToLeaderBoard.gameObject.transform.GetChild(i).GetComponent <Text>().text = LankingScore[i].ToString(); } } }