private void OnEnable()
        {
            Runemark.Common.RunemarkDebug.Log("Try to reset global variables: {0}", Variables.GetAll().Count);

            foreach (var v in Variables.GetAll())
            {
                Common.RunemarkDebug.Log("{0} {1} reset.", v.Name, (v.Save ? "shouldn't" : "should"));
                if (!v.Save)
                {
                    v.Reset();
                }
            }
        }
        protected void CollectVariableNames(IVariableNode node, VariableScope scope)
        {
            VariableCollection variables = null;

            if (scope == VariableScope.Local)
            {
                variables = node.Root.Variables;
            }
            else if (scope == VariableScope.Global)
            {
                var gList   = Resources.LoadAll <DialogueSystemGlobals>("");
                var globals = (gList.Length > 0) ? gList[0] : null;
                if (globals != null)
                {
                    variables = globals.Variables;
                }
            }

            List <string> list = new List <string>();
            int           cnt  = 0;

            foreach (var g in variables.GetAll())
            {
                if (node.VariableName == g.Name)
                {
                    _selected = cnt;
                }
                list.Add(g.Name);
                cnt++;
            }
            _variables = list.ToArray();
        }