Page 1 of 1
Scene Change?
Posted: Wed Apr 24, 2019 6:39 pm
by wiverson
Best method to call to programmatically change scenes?
IIRC there is a particular method to call that does the Right Thing(tm) for things like avoiding messages for objects destroyed due to scene change, but I can't seem to find it. :\
Re: Scene Change?
Posted: Wed Apr 24, 2019 6:55 pm
by Tony Li
SaveSystem.LoadScene().
It does the following:
- 1. Tells all saver components in the current scene to save their state.
- 2. Tells all saver components that they're going to be unloaded, so if they update a counter when destroyed they should ignore it this time.
- 3. If there's a Scene Transition Manager, plays the "leaving the current scene" transition (e.g., fade out or load a loading screen scene).
- 4. Loads the next scene async.
- 5. If there's a Scene Transition Manager, plays the "entering the new scene" transition (e.g., fade in).
- 6. Tells all saver components in the new scene to update their state from the save data.
Re: Scene Change?
Posted: Thu Apr 25, 2019 1:28 pm
by wiverson