Instead of using hardcoded scene index value you could get active scene and reload it by its index or name:
static void Reload() {
var activeScene = SceneManager.GetActiveScene();
SceneManager.LoadScene(activeScene.buildIndex);
}
Instead of using hardcoded scene index value you could get active scene and reload it by its index or name:
static void Reload() {
var activeScene = SceneManager.GetActiveScene();
SceneManager.LoadScene(activeScene.buildIndex);
}
Thank you very much! Only in my project it worked without “static” just void ReloadScene.