Hi I bought the asset a few days ago, and for some time I'm trying to understand how to keep track of my variables.
In conversation i call this function :
using PixelCrushers.DialogueSystem;
...
void Update(){
print(DialogueLua.GetVariable("Money").AsFloat);
}
Your dialogue database contains design-time data. At runtime, the Dialogue System loads the values of your dialogue database into a Lua environment so you can manipulate it. To access the runtime data, use the DialogueLua class.
Is there a onChangedEvent for variables one can subscribe to? E.g. I'm having a number variable "Money". In a script I want to get notified whenever the variable gets updated.
Yes; you can add a Lua Observer, which lets you observe the return value of any expression, not just variables, for changes. For efficiency, it's best to set the frequency to EveryDialogueEntry or EndOfConversation.