IEnumerator PlayTime() { NP.SetActive(true); STB.SetActive(true); while (Flags.instance.isPlayEnd == false) { next = j - n; Flags.instance.isPlayStart = true; //配列の添え字は0~9 if (j < 10) { question.text = array2D[0, j].ToString() + "+" + array2D[1, j].ToString() + "="; } else { question.text = ""; } //入力判定 if (inputNumber <= 10) { //N個前の答えとマッチ if (inputNumber == answers[j - n]) { //正解 panel[inputNumber].EffectSign(0); sound.GoodSE(); inputNumber = 11; j++; rest--; } else { //不正解 panel[inputNumber].EffectSign(1); sound.BadSE(); inputNumber = 11; } //残りゼロ→終了 if (rest <= 0) { sound.ClearSE(); question.text = "Finish"; Flags.instance.isPlayEnd = true; Flags.instance.isPlayStart = false; //0=通常終了フラグを渡して終わり STB.SetActive(false); HintB.SetActive(false); result.ResultStart(0); yield break; } yield return(null); } yield return(null); } yield return(null); }