public static void LoadChanges(Params parameters) { string path; #if UNITY_STANDALONE || UNITY_EDITOR path = Application.dataPath; #else path = $"{Application.persistentDataPath}/GlobalData.arcueid"; #endif #if UNITY_STANDALONE || UNITY_EDITOR if (!ParadoxSerialization.CheckFolder($"{path}/Save")) { ParadoxSerialization.CreateFolder(path, "Save"); CreateData(parameters, $"{path}/Save/GlobalData.arcueid"); return; } if (!ParadoxSerialization.CheckFile($"{path}/Save/GlobalData.arcueid")) { CreateData(parameters, $"{path}/Save/GlobalData.arcueid"); return; } #else if (!ParadoxSerialization.CheckFile(path)) { CreateData(parameters, path); return; } #endif #if UNITY_STANDALONE || UNITY_EDITOR SaveGlobal data = _dataInterface.LoadData($"{path}/Save/GlobalData.arcueid"); #else SaveGlobal data = _dataInterface.LoadData(path); #endif for (int i = 0; i < data.intData.Count; i++) { parameters.intData[i].Value = data.intData[i]; } for (int i = 0; i < data.floatData.Count; i++) { parameters.floatData[i].Value = data.floatData[i]; } for (int i = 0; i < data.boolData.Count; i++) { parameters.boolData[i].Value = data.boolData[i]; } for (int i = 0; i < data.stringData.Count; i++) { parameters.stringData[i].Value = data.stringData[i]; } }
public static void LoadSettings(System.Action <SaveGlobal> OnComplete, SettingsManager manager) { string path; #if UNITY_STANDALONE || UNITY_EDITOR path = Application.dataPath; #else path = $"{Application.persistentDataPath}/Settings.arcueid"; #endif #if UNITY_STANDALONE || UNITY_EDITOR if (!ParadoxSerialization.CheckFolder($"{path}/Save")) { ParadoxSerialization.CreateFolder(path, "Save"); manager.GetData().SaveData($"{path}/Save/Settings.arcueid", true); return; } if (!ParadoxSerialization.CheckFile($"{path}/Save/Settings.arcueid")) { manager.GetData().SaveData($"{path}/Save/Settings.arcueid", true); return; } #else if (!ParadoxSerialization.CheckFile(path)) { manager.GetData().SaveData($"{path}/Save/Settings.arcueid", true); return; } #endif #if UNITY_STANDALONE || UNITY_EDITOR SaveGlobal data = _dataInterface.LoadData($"{path}/Save/Settings.arcueid"); #else SaveGlobal data = _dataInterface.LoadData(path); #endif OnComplete(data); }