예제 #1
0
        public static void SaveChanges(Params parameters)
        {
#if UNITY_STANDALONE || UNITY_EDITOR
            SaveGlobal data = _dataInterface.LoadData($"{Application.dataPath}/Save/GlobalData.arcueid");
#else
            SaveGlobal data = _dataInterface.LoadData($"{Application.persistentDataPath}/GlobalData.arcueid");
#endif

            for (int i = 0; i < data.intData.Count; i++)
            {
                data.intData[i] = parameters.intData[i].Value;
            }

            for (int i = 0; i < data.floatData.Count; i++)
            {
                data.floatData[i] = parameters.floatData[i].Value;
            }

            for (int i = 0; i < data.boolData.Count; i++)
            {
                data.boolData[i] = parameters.boolData[i].Value;
            }

            for (int i = 0; i < data.stringData.Count; i++)
            {
                data.stringData[i] = parameters.stringData[i].Value;
            }


#if UNITY_STANDALONE || UNITY_EDITOR
            data.SaveData($"{Application.dataPath}/Save/GlobalData.arcueid", true);
#else
            data.SaveData($"{Application.persistentDataPath}/GlobalData.arcueid", true);
#endif
        }
예제 #2
0
        public static void SaveSettings(SaveGlobal data)
        {
#if UNITY_STANDALONE || UNITY_EDITOR
            data.SaveData($"{Application.dataPath}/Save/Settings.arcueid", true);
#else
            data.SaveData($"{Application.persistentDataPath}/Settings.arcueid", true);
#endif
        }
예제 #3
0
        private static void CreateData(Params parameters, string path)
        {
            SaveGlobal data = new SaveGlobal()
            {
                intData = new List <int>(), floatData = new List <float>(), boolData = new List <bool>(), stringData = new List <string>()
            };


            for (int i = 0; i < parameters.intData.Count; i++)
            {
                data.intData.Add(parameters.intData[i].Value);
            }

            for (int i = 0; i < parameters.floatData.Count; i++)
            {
                data.floatData.Add(parameters.floatData[i].Value);
            }

            for (int i = 0; i < parameters.boolData.Count; i++)
            {
                data.boolData.Add(parameters.boolData[i].Value);
            }

            for (int i = 0; i < parameters.stringData.Count; i++)
            {
                data.stringData.Add(parameters.stringData[i].Value);
            }

            data.SaveData(path, true);
        }