Scene Change?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
wiverson
Posts: 22
Joined: Wed Feb 13, 2019 7:49 pm

Scene Change?

Post 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. :\
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Scene Change?

Post 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.
User avatar
wiverson
Posts: 22
Joined: Wed Feb 13, 2019 7:49 pm

Re: Scene Change?

Post by wiverson »

:D
Post Reply