我需要重新启动按钮的帮助..当我重新加载场景时,所有进程都将停止。 //开始
void Start()
{
if (NoAnsweredQuestion == null || NoAnsweredQuestion.Count == 0)
{
NoAnsweredQuestion = question.ToList<Question>();
}
SetcurrentQuestion();
StartCoroutine("CountDownTimer");
}
//设置当前问题
void SetcurrentQuestion()
{
int randomQuestionIndex = Random.Range(0, NoAnsweredQuestion.Count);
currentQuestion = NoAnsweredQuestion[randomQuestionIndex];
factText.text = currentQuestion.fact;
correctAnswerText.text = currentQuestion.answered;
}
//过渡
IEnumerator TransitiontoNextQuestion()
{
NoAnsweredQuestion.Remove(currentQuestion);
yield return new WaitForSeconds(delaybetweenquestion);
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
答案 0 :(得分:0)
这是我游戏的重启按钮
public void restart()
{
WWWForm form = new WWWForm();
WWW www = new WWW(restartBegGrammarIAQ, form);
Application.LoadLevel(Application.loadedLevel);
}