public void load_masterdata() { masterStage.Load(data_holder.Get("master_stage")); masterCorridor.Load(data_holder.Get("master_corridor")); masterCorridorEvent.Load(data_holder.Get("master_corridor_event")); masterCard.Load(data_holder.Get("master_card")); masterCardSymbol.Load(data_holder.Get("master_card_symbol")); masterChara.Load(data_holder.Get("master_chara")); masterCharaCard.Load(data_holder.Get("master_chara_card")); masterItem.Load(data_holder.Get("master_item")); masterStageWave.Load(data_holder.Get("master_stage_wave")); masterStageEvent.Load(data_holder.Get("master_stage_event")); masterStageItem.Load(data_holder.Get("master_stage_item")); masterStageCard.Load(data_holder.Get("master_stage_card")); masterStageMission.Load(data_holder.Get("master_stage_mission")); masterStageEnemy.Load(data_holder.Get("master_stage_enemy")); masterStageBattleBonus.Load(data_holder.Get("master_stage_bb")); masterStageShopItem.Load(data_holder.Get("master_stage_shopitem")); masterSkill.Load(data_holder.Get("master_skill")); masterSkillEffect.Load(data_holder.Get("master_skill_effect")); masterBattleBonus.Load(data_holder.Get("master_bb")); masterMission.Load(data_holder.Get("master_mission")); masterMissionDetail.Load(data_holder.Get("master_mission_detail")); masterHelp.Load(data_holder.Get("master_help")); }
private IEnumerator init_network() { GetAgingState(); gameData.SetSaveFilename(Defines.FILENAME_GAMEDATA); if (false == gameData.Load()) { // なんか初期化する必要あるなら } if (!user_data.HasKey(Defines.KEY_SOUNDVOLUME_BGM)) { Debug.Log("not haskey:Defines.KEY_SOUNDVOLUME_BGM"); user_data.WriteFloat(Defines.KEY_SOUNDVOLUME_BGM, 0.8f); } if (!user_data.HasKey(Defines.KEY_SOUNDVOLUME_SE)) { Debug.Log("not haskey:Defines.KEY_SOUNDVOLUME_SE"); user_data.WriteFloat(Defines.KEY_SOUNDVOLUME_SE, 0.8f); } // master masterChara.Load(masterTextAssets.Get("master_chara")); masterCharaCard.Load(masterTextAssets.Get("master_chara_card")); masterStage.Load(masterTextAssets.Get("master_stage")); masterCard.Load(masterTextAssets.Get("master_card")); masterCardSymbol.Load(masterTextAssets.Get("master_card_symbol")); masterItem.Load(masterTextAssets.Get("master_item")); masterStageItem.Load(masterTextAssets.Get("master_stage_item")); masterStageCard.Load(masterTextAssets.Get("master_card")); masterSkill.Load(masterTextAssets.Get("master_skill")); masterCampItem.Load(masterTextAssets.Get("master_campitem")); masterCampShop.Load(masterTextAssets.Get("master_campshop")); masterLevelup.Load(masterTextAssets.Get("master_levelup")); masterHelp.Load(masterTextAssets.Get("master_help")); // data dataStage.SetSaveFilename(Defines.FILENAME_DATA_STAGE); dataUnitCamp.SetSaveFilename(Defines.FILENAME_UNIT_CAMP); dataUnitGame.SetSaveFilename(Defines.FILENAME_UNIT_GAME); dataSkill.SetSaveFilename(Defines.FILENAME_SKILL_CAMP); dataItem.SetSaveFilename(Defines.FILENAME_ITEM_CAMP); dataCard.SetSaveFilename(Defines.FILENAME_CARD_CAMP); dataCampItem.SetSaveFilename(Defines.FILENAME_ITEM_CAMP); dataPresent.SetSaveFilename(Defines.FILENAME_DATA_PRESENT); if (false == dataUnitCamp.LoadMulti()) { dataUnitCamp.MakeInitialData(masterChara.list); dataUnitCamp.Save(); //yield return StartCoroutine(dataUnitCamp.SpreadSheet(SS_TEST, "unit", () => { })); } if (false == dataSkill.LoadMulti()) { dataSkill.MakeInitialData(); dataSkill.Save(); } //yield return StartCoroutine(dataItem.SpreadSheet(SS_TEST, "item", () => { })); if (false == dataCampItem.LoadMulti()) { dataCampItem.list.Clear(); dataCampItem.Save(); //yield return StartCoroutine(dataCampItem.SpreadSheet(SS_TEST, "campitem", () => { })); } if (false == dataItem.LoadMulti()) { dataItem.list.Clear(); dataItem.Save(); } if (false == dataStage.LoadMulti()) { // まだデータなし dataStage.Save(); } if (false == dataCard.LoadMulti()) { dataCard.Reset(dataUnitCamp.list, masterCard.list, masterCharaCard.list); dataCard.Save(); } if (false == dataPresent.LoadMulti()) { dataPresent.Save(); } yield return(null); Initialized = true; }
private IEnumerator init_network() { //Debug.Log(config.ReadInt("stage_id")); if (!user_data.HasKey(Defines.KEY_SOUNDVOLUME_BGM)) { Debug.Log("not haskey:Defines.KEY_SOUNDVOLUME_BGM"); user_data.WriteFloat(Defines.KEY_SOUNDVOLUME_BGM, 0.8f); } if (!user_data.HasKey(Defines.KEY_SOUNDVOLUME_SE)) { Debug.Log("not haskey:Defines.KEY_SOUNDVOLUME_SE"); user_data.WriteFloat(Defines.KEY_SOUNDVOLUME_SE, 0.8f); } if (!user_data.HasKey(Defines.KEY_GAMESPEED)) { Debug.Log("not haskey:Defines.KEY_GAMESPEED"); user_data.WriteInt(Defines.KEY_GAMESPEED, 0); } game_speed_index = user_data.ReadInt(Defines.KEY_GAMESPEED); SetGameSpeed(game_speed_index); //Debug.Log(user_data.ReadFloat(Defines.KEY_SOUNDVOLUME_BGM)); //Debug.Log(user_data.ReadFloat(Defines.KEY_SOUNDVOLUME_SE)); gameData.SetSaveFilename(Defines.FILENAME_GAMEDATA); if (false == gameData.LoadMulti()) { gameData.AddInt(Defines.KEY_MP, 0); gameData.AddInt(Defines.KEY_MP_MAX, 30); } GetAgingState(); masterStage.Load(data_holder.Get("master_stage")); masterCorridor.Load(data_holder.Get("master_corridor")); masterCorridorEvent.Load(data_holder.Get("master_corridor_event")); masterCard.Load(data_holder.Get("master_card")); masterCardSymbol.Load(data_holder.Get("master_card_symbol")); masterChara.Load(data_holder.Get("master_chara")); masterCharaCard.Load(data_holder.Get("master_chara_card")); masterItem.Load(data_holder.Get("master_item")); masterStageWave.Load(data_holder.Get("master_stage_wave")); masterStageEvent.Load(data_holder.Get("master_stage_event")); masterStageItem.Load(data_holder.Get("master_stage_item")); masterStageCard.Load(data_holder.Get("master_stage_card")); masterStageMission.Load(data_holder.Get("master_stage_mission")); masterStageEnemy.Load(data_holder.Get("master_stage_enemy")); masterStageBattleBonus.Load(data_holder.Get("master_stage_bb")); masterStageShopItem.Load(data_holder.Get("master_stage_shopitem")); masterSkill.Load(data_holder.Get("master_skill")); masterSkillEffect.Load(data_holder.Get("master_skill_effect")); masterBattleBonus.Load(data_holder.Get("master_bb")); masterMission.Load(data_holder.Get("master_mission")); masterMissionDetail.Load(data_holder.Get("master_mission_detail")); masterHelp.Load(data_holder.Get("master_help")); yield return(null); dataCorridor.SetSaveFilename(Defines.FILENAME_DATA_CORRIDOR); dataUnit.SetSaveFilename(Defines.FILENAME_UNIT_GAME); dataSkill.SetSaveFilename(Defines.FILENAME_SKILL_GAME); dataItem.SetSaveFilename(Defines.FILENAME_ITEM_GAME); dataCard.SetSaveFilename(Defines.FILENAME_CARD_GAME); dataStage.SetSaveFilename(Defines.FILENAME_DATA_STAGE); if (false == dataUnit.LoadMulti()) { dataUnit.MakeInitialData(masterChara.list); } if (false == dataSkill.LoadMulti()) { //yield return StartCoroutine(dataSkill.SpreadSheet(SS_TEST, "skill", () => { })); } if (false == dataItem.LoadMulti()) { //yield return StartCoroutine(dataItem.SpreadSheet(SS_TEST, "item", () => { })); } if (false == dataStage.LoadMulti()) { Debug.LogError("no data stage"); } if (false == dataCard.LoadMulti()) { } if (false == dataCorridor.LoadMulti()) { } Initialized = true; }
IEnumerator init_network() { Debug.Log("init_network start"); yield return(StartCoroutine(config.SpreadSheet(Defines.SS_MASTER, "config", () => { }))); masterChara.SetSaveFilename(Defines.FILENAME_MASTERCHARA); masterChara.Load(m_textAssetHolder.Get("master_chara")); masterWeapon.Load(m_textAssetHolder.Get("master_weapon")); masterArmor.Load(m_textAssetHolder.Get("master_armor")); masterSkill.Load(m_textAssetHolder.Get("master_skill")); masterPotion.Load(m_textAssetHolder.Get("master_potion")); masterTreasure.Load(m_textAssetHolder.Get("master_treasure")); masterEnemy.Load(m_textAssetHolder.Get("master_enemy")); masterItem.Load(m_textAssetHolder.Get("master_item")); masterStage.Load(m_textAssetHolder.Get("master_stage")); masterFloor.Load(m_textAssetHolder.Get("master_floor")); masterHelp.Load(m_textAssetHolder.Get("master_help")); #if UNITY_EDITOR if (m_bLoadNetworkData) { #region 通信初期化 yield return(StartCoroutine(masterChara.SpreadSheet(Defines.SS_MASTER, "chara", () => { }))); yield return(StartCoroutine(masterWeapon.SpreadSheet(Defines.SS_MASTER, "weapon", () => { }))); yield return(StartCoroutine(masterArmor.SpreadSheet(Defines.SS_MASTER, "armor", () => { }))); yield return(StartCoroutine(masterSkill.SpreadSheet(Defines.SS_MASTER, "skill", () => { }))); yield return(StartCoroutine(masterPotion.SpreadSheet(Defines.SS_MASTER, "potion", () => { }))); yield return(StartCoroutine(masterTreasure.SpreadSheet(Defines.SS_MASTER, "treasure", () => { /* * foreach( MasterTreasureParam master in masterTreasure.list) * { * Debug.Log(string.Format("id:{0} name:{1} sprite:{2}", master.treasure_id , master.name , master.sprite_name)); * } */ }))); yield return(StartCoroutine(masterEnemy.SpreadSheet(Defines.SS_MASTER, "enemy", () => { }))); yield return(StartCoroutine(masterItem.SpreadSheet(Defines.SS_MASTER, "item", () => { }))); yield return(StartCoroutine(masterStage.SpreadSheet(Defines.SS_MASTER, "stage", () => { }))); yield return(StartCoroutine(masterFloor.SpreadSheet(Defines.SS_MASTER, "floor", () => { }))); yield return(StartCoroutine(masterHelp.SpreadSheet(Defines.SS_MASTER, "help", () => { }))); #endregion } #endif // 未初期化扱い if (!user_data.HasKey(Defines.KEY_AUTOPOTION_RATE)) { user_data.WriteInt(Defines.KEY_USE_AUTOMOVE, 1); user_data.WriteInt(Defines.KEY_USE_AUTOPOTION, 1); user_data.WriteFloat(Defines.KEY_AUTOPOTION_RATE, Defines.DEFAULT_AUTOPOTION_RATE); user_data.WriteFloat(Defines.KEY_SOUNDVOLUME_BGM, Defines.SOUND_VOLME_DEFAULT); user_data.WriteFloat(Defines.KEY_SOUNDVOLUME_SE, Defines.SOUND_VOLME_DEFAULT); } game_data.SetSaveFilename(Defines.FILENAME_GAMEDATA); if (game_data.LoadMulti() == false) { // なんかする // なにもしなくてok } dataChara.SetSaveFilename(Defines.FILENAME_DATACHARA); if (dataChara.LoadMulti() == false) { // 初期データ的ななにか保存はしない DataCharaParam slime = new DataCharaParam(); slime.chara_id = 1; slime.status = DataChara.STATUS.USING.ToString(); dataChara.list.Add(slime); } dataWeapon.SetSaveFilename(Defines.FILENAME_DATAWEAPON); if (dataWeapon.LoadMulti() == false) { DataWeaponParam add_weapon = new DataWeaponParam(); add_weapon.weapon_id = 1; add_weapon.level = 1; add_weapon.equip = 1; // 武器はtfで良いのでは? dataWeapon.Add(add_weapon); } dataWeaponAlbum.SetSaveFilename(Defines.FILENAME_DATAWEAPONALBUM); if (dataWeaponAlbum.LoadMulti() == false) { dataWeaponAlbum.AddAlbum(1); } dataArmor.SetSaveFilename(Defines.FILENAME_DATAARMOR); if (dataArmor.LoadMulti() == false) { for (int i = 0; i < MasterArmor.ArmorPositionArr.Length; i++) { DataArmorParam add = new DataArmorParam(); add.position = MasterArmor.ArmorPositionArr[i]; add.level = 1; MasterArmorParam mas = masterArmor.list.Find(p => p.position == add.position && p.level == add.level); add.armor_id = mas.armor_id; dataArmor.list.Add(add); } } dataSkill.SetSaveFilename(Defines.FILENAME_DATASKILL); if (dataSkill.LoadMulti() == false) { dataSkill.list.Add(new DataSkillParam(1, 1)); } dataPotion.SetSaveFilename(Defines.FILENAME_DATAPOTION); if (dataPotion.LoadMulti() == false) { DataPotionParam add = new DataPotionParam(); add.potion_id = 1; add.num = 9; add.is_use = true; dataPotion.list.Add(add); } dataTreasure.SetSaveFilename(Defines.FILENAME_DATATREASURE); if (dataTreasure.LoadMulti() == false) { /* * int add_serial = dataTreasure.Add(1001); * DataTreasureParam add_treasure = dataTreasure.list.Find(p => p.serial == add_serial); * add_treasure.equip = 1; */ } dataTreasureAlbum.SetSaveFilename(Defines.FILENAME_DATATREASUREALBUM); if (dataTreasureAlbum.LoadMulti() == false) { /* * dataTreasureAlbum.Add(1002); * dataTreasureAlbum.Add(1003); * dataTreasureAlbum.Add(1006); * dataTreasureAlbum.Add(1010); * dataTreasureAlbum.Add(1026); */ } /* * dataScroll.SetSaveFilename(Defines.FILENAME_DATASCROLL); * if( dataScroll.LoadMulti()== false) * { * dataScroll.list.Add(new DataScrollParam(1, 120)); * dataScroll.list.Add(new DataScrollParam(2, 120)); * dataScroll.list.Add(new DataScrollParam(3, 120)); * dataScroll.list.Add(new DataScrollParam(4, 120)); * dataScroll.list.Add(new DataScrollParam(5, 120)); * } */ dataUnit.SetSaveFilename(Defines.FILENAME_DATAUNIT); if (dataUnit.LoadMulti() == false) { } dataItem.SetSaveFilename(Defines.FILENAME_DATAITEM); if (dataItem.LoadMulti() == false) { for (int i = 0; i < 5; i++) { dataItem.Add(Defines.ITEM_ID_SCROLL_BLUE + i, 0); } } dataGetItem.SetSaveFilename(Defines.FILENAME_DATAITEM_GET); if (dataGetItem.LoadMulti() == false) { } dataStage.SetSaveFilename(Defines.FILENAME_DATASTAGE); if (dataStage.LoadMulti() == false) { DataStageParam data = new DataStageParam(); data.stage_id = 1; data.status = 1; dataStage.list.Add(data); } dataFloor.SetSaveFilename(Defines.FILENAME_DATAFLOOR); if (dataFloor.LoadMulti() == false) { DataFloorParam data = new DataFloorParam(); data.floor_id = 1; data.status = 1; dataFloor.list.Add(data); } if (m_txtKey != null) { user_data.AddListenerInt(Defines.KeyKey, (iValue) => { m_txtKey.text = iValue.ToString(); }); user_data.AddListenerInt(Defines.KeyGoldKey, (iValue) => { m_txtGoldKey.text = iValue.ToString(); }); user_data.AddListenerInt(Defines.KeyCoin, (iValue) => { m_txtCoin.text = iValue.ToString(); }); user_data.AddListenerInt(Defines.KeyGem, (iValue) => { m_txtGem.text = iValue.ToString(); }); #if UNITY_EDITOR /* * AddGem(debug_gem); * AddCoin(debug_coin); * AddKey(debug_key); * AddGoldKey(debug_gold_key); */ #endif //m_txtKey.text = user_data.ReadInt(Defines.KeyKey).ToString(); ; //m_txtGoldKey.text = user_data.Read(Defines.KeyGoldKey); //m_txtCoin.text = user_data.Read(Defines.KeyCoin); //m_txtGem.text = user_data.Read(Defines.KeyGem); } Initialized = true; Debug.Log("init_network end"); yield return(null); }