Esempio n. 1
0
        public override string SaveData()
        {
            VariablesData data = new VariablesData();

            foreach (GVar var in Variables.vars)
            {
                var.Download(VariableLocation.Component);
            }

            data.variablesData = SaveSystem.CreateVariablesData(Variables.vars, false, VariableLocation.Component);

            return(Serializer.SaveScriptData <VariablesData> (data));
        }
Esempio n. 2
0
        public override void LoadData(string stringData)
        {
            VariablesData data = Serializer.LoadScriptData <VariablesData> (stringData);

            if (data == null)
            {
                loadedData = false;
                return;
            }
            SavePrevented = data.savePrevented; if (savePrevented)
            {
                return;
            }

            Variables.vars = SaveSystem.UnloadVariablesData(data.variablesData, Variables.vars);

            foreach (GVar var in Variables.vars)
            {
                var.Upload(VariableLocation.Component);
            }

            loadedData = true;
        }