For some Scenes in my game I have 2 version, one “initial” version that is only used if it’s a new game. And one “_Load” that is used if the game is loaded from a save. Ex:
Initial Scene: “Village”
Scene in loaded game: “Village_Load”
In order to Load the correct Scene I created a method, but it seems “IsValid()” is not doing what I want. Since even if a Scene has a “_Load” version, it returns false (I always post the Initial Scene name as parameter):
public string GetSceneVersion(string scene)
{
if (newGame)
{
return scene;
}
else
{
if (!SceneManager.GetSceneByName(scene + "_Load").IsValid())
{
Debug.Log(scene + " only has one version");
return scene;
}
else
{
Debug.Log(scene + " has a _Load version");
return scene + "_Load";
}
}
}
Is there some mistake here? Or does “IsValid()” Not find all Scenes in build? If not, what could I do instead?