When quests, variables are loaded.
When quests, variables are loaded.
Hello. I want to initialize stuff on scene load, by checking quest, variables states. When to check these? In Awake, Start or there is an event that I can subscribe to e.g OnQuestLoad?
Re: When quests, variables are loaded.
Hi,
If you want to know when the Dialogue Manager has loaded the dialogue database into memory and prepared the Lua environment, hook into DialogueManager.instance.initializationComplete:
If you want to know when the save system has finished loading a scene and applying saved game data, hook into SaveSystem.saveDataApplied:
If you want to know when the Dialogue Manager has loaded the dialogue database into memory and prepared the Lua environment, hook into DialogueManager.instance.initializationComplete:
Code: Select all
void Awake()
{
DialogueManager.instance.initializationComplete += OnDialogueSystemReady;
}
void OnDialogueSystemReady()
{
DialogueManager.instance.initializationComplete -= OnDialogueSystemReady;
// (Do your thing here.)
}
Code: Select all
void Awake()
{
// Save system may take more than one frame after scene starts to apply save data.
// (You can configure the number of frames on the Save System GameObject.)
SaveSystem.saveDataApplied += OnSavedDataApplied;
}
void OnSaveDataApplied()
{
SaveSystem.saveDataApplied += OnSavedDataApplied;
// (Do your thing here.)
}
Re: When quests, variables are loaded.
Great! Thank you!
Re: When quests, variables are loaded.
Happy to help!