Unity3d restart current scene

后端 未结 3 1838
既然无缘
既然无缘 2021-01-20 19:42

Ok so I am trying to restart the scene on R being pressed and for some reason, I am getting errors like, well in the unity console: \"unexpected symbol \'}\' \" and \"parsin

3条回答
  •  北恋
    北恋 (楼主)
    2021-01-20 20:03

    I can say that the code below might be the easiest method;

    SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    

提交回复
热议问题