Beispiel #1
0
    IEnumerator showReviewVocabulary()
    {
        StartCoroutine(pm.LoadVocabulary("loadVocabulary.php"));
        yield return(new WaitForSeconds(0.5f));

        UI_ShowMes.SetActive(false);
        showReviewUI();
        changeVocabularyID(0);
    }
Beispiel #2
0
 void Start()
 {
     UI_ShowMes.SetActive(true);
     UI_ShowMes.GetComponentInChildren <Text>().text = "載入中...";
     text_score     = score.GetComponentsInChildren <Text>()[0];
     ClickBtn       = GetComponentsInChildren <AudioSource>()[0];
     p_score        = 0;
     vocabularyID   = 0;
     C_correctNum   = -1; //當前連續答對題數
     max_correctNum = -1; //最大連續答對數
     correctNum     = 0;  //累計正確題數
     wrongNum       = 0;  //累計錯誤題數
     totalQuesNum   = 10; //練習題數
     showAchieve    = false;
     UIManager.Instance.CloseAllPanel();
 }
Beispiel #3
0
    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();
    }