当我单击按钮时,如何停止 NoAnsweredQuestion.Count ...
问题:
当我单击重置按钮时,NoAnsweredQuestion.Count
仍在计数到最大限制
随机:
private void SetcurrentQuestion()
{
int randomQuestionIndex = Random.Range(0, NoAnsweredQuestion.Count);
currentQuestion = NoAnsweredQuestion[randomQuestionIndex];
factText.text = currentQuestion.fact;
correctAnswerText.text = currentQuestion.answered;
}
这是我的限制:
public void ContinueTransition()
{
if (NoAnsweredQuestion.Count == 10)
{
FinalScore.SetActive(true);
}
else
{
StartCoroutine(TransitiontoNextQuestion());
updatequestion();
}
}
重置按钮:
public void Restart()
{
var form = new WWWForm();
var www = new WWW(restartBegGrammarIAQ, form);
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
Time.timeScale = 1f;
GameIsPaused = false;
}
答案 0 :(得分:1)
在您的重启方法中添加NoAnsweredQuestion.Clear()
,它应该可以工作