So this one was tricky, and it took me quite a while to figure out.
The most confusing part for me wasn’t actually the error message that started it all, it was the fact that when transitioning between scenes, RestoreState was never getting called at all on Inventory/health, etc, but it was getting called when restarting the game.
Portal looks normal, and debugs indicated that Portal simply stopped working on the call to Load.
That left me heading to SavingWrapper, where I found that Load() read
public void Load()
{
GetComponent<SavingSystem>.LoadLastScene();
}
So what’s happening is that when Portal calls SavingWrapper.Load(), SavingWrapper.Load() Loads the last scene, but because it’s calling LoadLastScene like a method instead of a Coroutine, all that effectively happens is that the scene is reloaded.
So I made the following changes to SavingWrapper.cs:
In Update(), I changed the call to Load() to
StartCoroutine(LoadLastScene());
Then for Load, I changed the contents to
GetComponent<SavingSystem>().Load(defaultSaveFile);
Interestingly enough, while this now made the saving and loading work correctly, the warning messages are still appearing when first loading with a save file, but they appear to have no impact whatsoever on saving and loading the game once the changes listed above are implemented.