Page 1 of 1

Best practice for quitting to main menu

Posted: Sun Apr 14, 2019 1:48 pm
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)

Re: Best practice for quitting to main menu

Posted: Sun Apr 14, 2019 3:27 pm
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.

Re: Best practice for quitting to main menu

Posted: Sun Apr 14, 2019 5:43 pm
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?

Re: Best practice for quitting to main menu

Posted: Sun Apr 14, 2019 6:42 pm
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?