SaveSystem.addedScenes and loading games
Posted: Mon Feb 21, 2022 12:47 pm
Hello Tony,
I hope you are doing great.
Had a bit of a headscratcher with SaveSystem.addedScenes.
Scenario #1:
After this, SaveSystem.addedScenes shows "City" in it, while in reality it's not.
I "fixed it" by just initializing scenes with SceneManager when loading games.
Scenario #2:
After this, SaveSystem.addedScenes is empty and loading scenes with SceneManager would end up me being unable Unload them using SaveSystem.
Well, again I "fixed it" by using SceneManager only when it's necessary (when scene is in addedScenes but not loaded).
This all seems really "hacky". I have this feeling I am doing something wrong? For a brief moment I used SceneManager to handle all the scene changes (to reduces the "hacky"), but I would prefer using SaveSystem to invoke Savers when loading/unloading scenes.
I hope you are doing great.
Had a bit of a headscratcher with SaveSystem.addedScenes.
Scenario #1:
Code: Select all
Start Game -> Load Additive Scene "City" -> Save Game (Slot 1) -> Main Menu -> Load Game (Slot 1).
I "fixed it" by just initializing scenes with SceneManager when loading games.
Scenario #2:
Code: Select all
Start Game -> Load Additive Scene "City" -> Save Game (Slot 1) -> Main Menu -> Quit Game -> Start Game ->Load Game (Slot 1)
Well, again I "fixed it" by using SceneManager only when it's necessary (when scene is in addedScenes but not loaded).
This all seems really "hacky". I have this feeling I am doing something wrong? For a brief moment I used SceneManager to handle all the scene changes (to reduces the "hacky"), but I would prefer using SaveSystem to invoke Savers when loading/unloading scenes.