Code: Select all
public void LoadLevel()
{
Debug.LogError("Loading Scene " + _sceneToLoad.value);
PixelCrushers.SaveSystem.LoadScene(_sceneToLoad.value);
}
The value _sceneToLoad.value is a scriptable object and the value is set in the previous scene. At the end of Chapter 1 it sets _sceneToLoad.value to Chapter 2 and at the end of Chapter 2 it sets _sceneToLoad.value to Chapter 3 and so on. So when the player enters the transition level the _sceneToLoad.value is already set from the previous level.
I have debugerror statements in my dev build that tell me what levels are going to be loaded next and what level is currently loading. It shows the correct level to load next but when LoadLevel is called t loadsa the previously saved level instead of the level from the _sceneToLoad.value. Which is already verified to be correct.