Page 1 of 1

Reset All Variables To Initial Value

Posted: Sun Jan 20, 2019 7:09 pm
by fl.isabela
Hi, I would like to reset all variables to their initial value when my scene is loaded. Is there a simple way to do so?
Thanks!

Re: Reset All Variables To Initial Value

Posted: Sun Jan 20, 2019 9:36 pm
by Tony Li
Hi,

Yes, call DialogueManager.ResetDatabase or use the equivalent visual scripting action in PlayMaker, Bolt, etc.

For example, if you put this script on a GameObject in your scene, it will reset the database:

ResetDatabaseOnStart.cs

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;
public ResetDatabaseOnStart : MonoBehaviour
{
    void Start()
    {
        DialogueManager.ResetDatabase(DatabaseResetOptions.KeepAllLoaded);
    }
}

Re: Reset All Variables To Initial Value

Posted: Mon Jan 21, 2019 5:58 pm
by fl.isabela
Hi Tony, thanks for the reply! I'll try to implement your suggestion!
=)