Reset all variables

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
DumplingQ
Posts: 10
Joined: Fri Apr 07, 2023 12:02 pm

Reset all variables

Post by DumplingQ »

Hello, I have a bunch of variables and quests set in my dialogue database and now I want to reset these variables to their default values when the player presses "reset", what should I do? :shock:
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Reset all variables

Post by Tony Li »

Hi,

Use this line of C#:

Code: Select all

PixelCrushers.DialogueSystem.DialogueManager.ResetDatabase();
Or, if you're using the Save System:

Code: Select all

PixelCrushers.SaveSystem.ResetGameState();
which automatically calls DialogueManager.ResetDatabase() (assuming your Dialogue Manager has a DialogueSystemSaver component).

If you don't want to write any code, you can add a SaveSystemMethods component to a UI Button and configure its OnClick() event call SaveSystemMethods.ResetGameGame.
Post Reply