//その日最初の起動で、天候の日数を進めスタートの風向きと気温を設定する public void InitWeather(bool isNewUser, bool isNewDay) { weather = new FieldWeather(); int[] rireki = ES2.LoadArray <int>(DataManger.DataFilename + "?tag=Field_weatherRireki"); if (rireki.Length != 7 && !isNewUser) { Debug.LogError("newUser==falseなのに天気がおかしい!"); isNewUser = true; } if (isNewUser) { Debug.Log("全体の天候 新規作成"); List <WeatherType> rireki2 = new List <WeatherType>(); rireki2.Add(GetWeather()); rireki2.Add(GetWeather()); rireki2.Add(GetWeather()); rireki2.Add(GetWeather()); rireki2.Add(GetWeather()); rireki2.Add(GetWeather()); rireki2.Add(GetWeather()); weather.weatherRireki = rireki2; weather.startKionAt = GetStartKion(); weather.WindDirection = GetStartWind(); //save Data ES2.Save(weather.RirekiToIntArray(), DataManger.DataFilename + "?tag=Field_weatherRireki"); ES2.Save(weather.startKionAt, DataManger.DataFilename + "?tag=Field_startKion"); ES2.Save(weather.WindDirection, DataManger.DataFilename + "?tag=Field_windDirection"); } else { Debug.Log("全体の天候 ロード"); List <WeatherType> weatherRireki = new List <WeatherType>(); for (int i = 0; i < rireki.Length; i++) { weatherRireki.Add((WeatherType)rireki[i]); } this.weather.weatherRireki = weatherRireki; if (isNewDay) { Debug.LogError("全体の天候 次の日に"); //天気を追加する weather.weatherRireki.RemoveAt(0); weather.weatherRireki.Add(GetWeather()); weather.startKionAt = GetStartKion(); weather.WindDirection = GetStartWind(); //save Data ES2.Save(weather.RirekiToIntArray(), DataManger.DataFilename + "?tag=Field_weatherRireki"); ES2.Save(weather.startKionAt, DataManger.DataFilename + "?tag=Field_startKion"); ES2.Save(weather.WindDirection, DataManger.DataFilename + "?tag=Field_windDirection"); } else { weather.startKionAt = ES2.Load <int>(DataManger.DataFilename + "?tag=Field_startKion");; weather.WindDirection = ES2.Load <Vector3>(DataManger.DataFilename + "?tag=Field_windDirection");; } } UpdateFieldTime(); }
// Load Current Weapon Loadout public int[] LoadWeaponLoadout() { if (sCurrentFilePath == "" || sCurrentFilePath == null) { InitializeFile(); } if (ES2.Exists(sCurrentFilePath + "?tag=" + "Profile" + iCurrentProfileID + " Loadout")) { return(ES2.LoadArray <int>(sCurrentFilePath + "?tag=" + "Profile" + iCurrentProfileID + " Loadout")); } else { return(new int[0]); } }
private void GameEvents_GameLoaded(object sender, Events.GameEvents.SaveLoadEventArgs e) { String path = e.savePath; if (ES2.Exists(path)) { if (ES2.Exists(path + "?tag=CostTweaking_Costs")) { EntityCost[] costsData = ES2.LoadArray <EntityCost>(path + "?tag=CostTweaking_Costs"); foreach (EntityCost data in costsData) { Costs.SetEntityCost(data); if (_fields.ContainsKey(data.Internal_Name)) { foreach (TextField field in _fields[data.Internal_Name]) { field.Text = data.GetCost(field.Tag as String).ToString(); } } } } } }
public static void Load() { QuestManager.instance.questCompleted = ES2.LoadArray <bool>(folder + "Scenes.dat?tag=questCompleted"); }
public void LoadData() { Debug.Log("データのロード"); GAMEDATA = new VBFData(); GAMEDATA.Liked = ES2.Load <bool>(DataFilename + "?tag=isLiked"); GAMEDATA.expOnLevel = ES2.Load <int>(DataFilename + "?tag=expOnLevel"); GAMEDATA.totalWins = ES2.Load <int>(DataFilename + "?tag=totalWins"); GAMEDATA.earnedLoginBonus = ES2.Load <bool>(DataFilename + "?tag=earnedLoginBonus"); GAMEDATA.playerLevel = ES2.Load <int>(DataFilename + "?tag=playerLevel"); GAMEDATA.lastLoginTime = ES2.Load <string>(DataFilename + "?tag=lastLoginTime"); GAMEDATA.SPOfferLeft = ES2.Load <float>(DataFilename + "?tag=SPOfferLeft"); GAMEDATA.RenzokuLogin = ES2.Load <int>(DataFilename + "?tag=RenzokuLogin"); GAMEDATA.DayFromInstall = ES2.Load <int>(DataFilename + "?tag=DayFromInstall"); GAMEDATA.Countly = ES2.Load <string>(DataFilename + "?tag=Countly"); GAMEDATA.Gold = ES2.Load <long>(DataFilename + "?tag=Currency_Gold"); GAMEDATA.Doller = ES2.Load <long>(DataFilename + "?tag=Currency_Doller"); GAMEDATA.isAdFree = ES2.Load <bool>(DataFilename + "?tag=isAdFree"); GAMEDATA.lureHas_Hard = ES2.LoadDictionary <string, int>(DataFilename + "?tag=lureHas_Hard"); for (int i = 0; i < Constants.LureDatas.itemTittles.Length; i++) { if (!GAMEDATA.lureHas_Hard.ContainsKey(Constants.LureDatas.itemTittles[i])) { Debug.LogError("追加のルアーあり " + Constants.LureDatas.itemTittles[i]); GAMEDATA.lureHas_Hard.Add(Constants.LureDatas.itemTittles[i], 0); } } foreach (string value in GAMEDATA.lureHas_Hard.Keys) { GAMEDATA.lureHasDebug.Add(value + "/" + GAMEDATA.lureHas_Hard[value]); } GAMEDATA.lureHas_Soft = ES2.LoadDictionary <string, int>(DataFilename + "?tag=lureHas_Soft"); GAMEDATA.RigHas = ES2.LoadDictionary <string, bool>(DataFilename + "?tag=rigHas"); GAMEDATA.SettedRig = ES2.LoadDictionary <string, int>(DataFilename + "?tag=settedRig"); for (int i = 0; i < Constants.SoftLureDatas.itemTittles.Length; i++) { if (!GAMEDATA.lureHas_Soft.ContainsKey(Constants.SoftLureDatas.itemTittles[i])) { Debug.LogError("追加のSoftあり " + Constants.SoftLureDatas.itemTittles[i]); GAMEDATA.lureHas_Soft.Add(Constants.SoftLureDatas.itemTittles[i], 0); GAMEDATA.SettedRig.Add(Constants.SoftLureDatas.itemTittles[i], 0); } } for (int i = 0; i < Constants.RigDatas.itemTittles.Length; i++) { if (!GAMEDATA.RigHas.ContainsKey(Constants.RigDatas.itemTittles[i])) { Debug.LogError("追加のRigあり " + Constants.RigDatas.itemTittles[i]); GAMEDATA.RigHas.Add(Constants.RigDatas.itemTittles[i], false); } } foreach (string value in GAMEDATA.lureHas_Soft.Keys) { GAMEDATA.lureSoftHasDebug.Add(value + "/" + GAMEDATA.lureHas_Soft[value]); } foreach (string value in GAMEDATA.RigHas.Keys) { GAMEDATA.RigHasDebug.Add(value + "/" + GAMEDATA.RigHas[value]); } GAMEDATA.lureHas_Line = ES2.LoadDictionary <string, int>(DataFilename + "?tag=lureHas_Line"); for (int i = 0; i < Constants.LineDatas.itemTittles.Length; i++) { if (!GAMEDATA.lureHas_Line.ContainsKey(Constants.LineDatas.itemTittles[i])) { Debug.LogError("追加のLineあり " + Constants.LineDatas.itemTittles[i]); GAMEDATA.lureHas_Line.Add(Constants.LineDatas.itemTittles[i], 0); } } foreach (string value in GAMEDATA.lureHas_Line.Keys) { GAMEDATA.lureLineHasDebug.Add(value + "/" + GAMEDATA.lureHas_Line[value]); } GAMEDATA.lureHas_Rods = ES2.LoadDictionary <string, int>(DataFilename + "?tag=lureHas_Rods"); for (int i = 0; i < Constants.RodsDatas.itemTittles.Length; i++) { if (!GAMEDATA.lureHas_Rods.ContainsKey(Constants.RodsDatas.itemTittles[i])) { Debug.LogError("追加のRodsあり " + Constants.RodsDatas.itemTittles[i]); GAMEDATA.lureHas_Rods.Add(Constants.RodsDatas.itemTittles[i], 0); } } GAMEDATA.tackleSlots = new List <CurrentTackle>(); string[] tackles = ES2.LoadArray <string>(DataFilename + "?tag=tackleSlots"); for (int i = 0; i < Constants.RodsDatas.itemTittles.Length; i++) { CurrentTackle tcke = new CurrentTackle(); if (i >= tackles.Length) { Debug.LogError("追加のRodsあり " + Constants.RodsDatas.itemTittles[i]); tcke.name = Constants.RodsDatas.itemTittles[i]; GAMEDATA.tackleSlots.Add(tcke); } else { if (tcke.SetStringData(tackles[i])) { GAMEDATA.tackleSlots.Add(tcke); } else { Debug.LogError("Error:NO Data FAILURE"); } } } foreach (string value in GAMEDATA.lureHas_Rods.Keys) { GAMEDATA.lureRodsHasDebug.Add(value + "/" + GAMEDATA.lureHas_Rods[value]); } currentCategory = 0; previousCategory = 0; if (ES2.Load <string>(DataFilename + "?tag=culEntry") == "") { Debug.Log("Entry ==null"); GAMEDATA.currentEntry = null; } else { GAMEDATA.currentEntry = null; GAMEDATA.currentEntry = new EntryData(); if (GAMEDATA.currentEntry.SetFromStringData(ES2.Load <string>(DataFilename + "?tag=culEntry"))) { currentCategory = GAMEDATA.currentEntry.category; } else { Debug.Log("Error:NO ENTRY FAILURE"); } } if (ES2.Load <string>(DataFilename + "?tag=prevEntry") == "") { Debug.Log("Entry2 ==null"); GAMEDATA.prevEntry = null; } else { GAMEDATA.prevEntry = null; GAMEDATA.prevEntry = new EntryData(); if (GAMEDATA.prevEntry.SetFromStringData(ES2.Load <string>(DataFilename + "?tag=prevEntry"))) { previousCategory = GAMEDATA.prevEntry.category; } else { Debug.Log("Error:NO ENTRY FAILURE 2"); } } isDataLoaded = true; }