Best practice for quitting to main menu

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Best practice for quitting to main menu

Post by timbecile »

Hey Tony,

What is the best practice for handling quitting to the mail menu? I'm trying to get everything that's "Don't Destroy On Load" back to its factory settings when the main menu loads.

Right now after doing all that the Scene Transition Manager stored on the Dialog Manager breaks. I'm guessing that the dialog manager is still under Don't Destroy On Load.

So how should I deal with it? Should I destroy it before I load the Main Menu scene (that's where the DM is, I don't load it dynamically)
User avatar
Tony Li
Posts: 21080
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best practice for quitting to main menu

Post by Tony Li »

You can keep the original Dialogue Manager alive. Use this to reset it:

Code: Select all

DialogueManager.ResetDatabase(DatabaseResetOptions.RevertToDefault);
SaveSystem.ClearSavedGameData();
If you're not using the save system, you can skip the second line.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Best practice for quitting to main menu

Post by timbecile »

perfect!

One other issue. The StandardSceneTransitionManager loses the references to the objects and methods it uses for transition start and end triggers. Is there a way to set that via script?
User avatar
Tony Li
Posts: 21080
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best practice for quitting to main menu

Post by Tony Li »

timbecile wrote: Sun Apr 14, 2019 5:43 pmOne other issue. The StandardSceneTransitionManager loses the references to the objects and methods it uses for transition start and end triggers. Is there a way to set that via script?
If possible, put it all under the Dialogue Manager, like in DemoScene1. This way it sticks around through scene changes.

If that's not possible, you'll need to reassign events to the transition manager's onTransitionStart/onTransitionEnd events and/or leaveSceneTransition/enterSceneTransition fields. What references are getting lost?
Post Reply