For several variables in my game, it makes more sense to store them in other objects than inside of the Dialogue system itself. However, I still want Dialogue system to be able to refer to them, and display them to the user. For example, when you return from combat I want the general to refer to how many kills the player achieved. Though this variable is a part of the dialogue, it's really best served to be saved outside of the Dialogue System as part of a Scriptable Object, or even a Monobehavior.
Is there a way to achieve this? I suppose one solution would be to "push" the variable into a Dialogue System variable using
however this solution seems clunky. It raises more questions than it answers, such as how often I should call SetVariable, should it be even generated? Should it happen at specific times in my scene? Who's responsible for calling that function etc. What if I rename the variable on either end? It seems to be tightly coupled.