IEnumerator LearningEnd() { yield return(new WaitForSeconds(2f)); UIManager.Instance.TogglePanel("P_ResultUI", false); achievementState[0] = pm.setLearningCount("learning_count"); //更新單字練習次數 string[] s_state = pm.setLearningScore(p_score); //紀錄此次單字練習成績 if (s_state != null) { if (s_state[0] != null) { achievementState[1] = s_state[0]; //有達標 } if (s_state[1] != null) { achievementState[2] = s_state[1]; //分數進步 } } if (pm.setLearningCorrect(correctNum, wrongNum) != null) { achievementState[3] = pm.setLearningCorrect(correctNum, wrongNum); //更新單字答對與錯誤題數 } if (pm.setLearningMaxCorrect(max_correctNum) != null) { achievementState[4] = pm.setLearningMaxCorrect(max_correctNum); //連續答對題數 } /*---顯示獲得獎章與稱號---*/ for (int i = 0; i < achievementState.Length; i++) { if (achievementState[i] != null) { UI_ShowMes.SetActive(true); UI_ShowMes.GetComponentInChildren <Text>().text = achievementState[i]; switch (i) { case 0: Achievement.badgeName[0] = "練習不是一兩天的事"; break; case 1: Achievement.badgeName[1] = "得分魔人"; break; case 2: Achievement.badgeName[2] = "努力沒有白費"; break; case 3: Achievement.badgeName[3] = "難不倒我"; break; case 4: Achievement.badgeName[4] = "腳踏實地"; break; } } } /*--------------------------*/ yield return(new WaitForSeconds(1f)); showAchieve = true; SceneManager.LoadScene("Home"); UIManager.Instance.CloseAllPanel(); }