public bool LoadStageData(SaveDataStore saveData) { m_StageIndex = saveData.m_StageIndex - 1; if (m_StageIndex < 0 || m_StageIndex >= m_StageAssets.Length) { return(false); } m_Container = ObjectSaveLoad.JsonDataLoad <MapContainer>(m_StageAssets[m_StageIndex].text); m_Container.InitTileDataMap(); m_ShopItemList = m_Container.shopItemList; m_ShopWeaponList = m_Container.shopWeaponList; m_StageMapManager.CreateStageMap(m_Container); for (int i = 0; i < saveData.m_ChestStates.Count; i++) { HexCoord hex = new HexCoord(saveData.m_ChestStates[i].m_LocX, saveData.m_ChestStates[i].m_LocY); m_StageMapManager.GetMapTile(hex).SetChestState(saveData.GetChestState(hex)); } List <PlayerRecord> userPlayerRecords = GetUserPlayerRecords(saveData.m_UserPlayerRecords, saveData.m_StagePlayerRecords); List <PlayerRecord> enemyPlayerRecords = GetEnemyPlayerRecords(saveData.m_StageEnemyRecords); m_PlayerManager.GenetarePlayers(userPlayerRecords); m_PlayerManager.GenetarePlayers(enemyPlayerRecords); m_ScenarionManager.SetScenarion(m_Container.scenarionList, saveData.m_RemoveScenaroList); return(true); }
public static void SetSaveDataStore(int index, SaveDataStore saveDataStore) { if (index >= 0 && index < m_GameData.m_SaveDataStores.Count) { m_GameData.m_SaveDataStores[index] = saveDataStore; } }
public void SetPlayerItemData(SaveDataStore saveDataStore) { m_SaveData = saveDataStore; //_playerGold = saveDataStore.m_Gold; //m_PlayerItems = saveDataStore.m_PlayerItems; //m_PlayerWeapons = saveDataStore.m_PlayerWeapons; }
public PlayerSaveData() { for (int i = 0; i < 15; i++) { m_SaveDataStores.Add(new SaveDataStore()); } m_SaveDataStoreAuto = new SaveDataStore(); m_IsShowTile = true; m_IsShowPlayerUI = true; }
private void GameLoading() { m_GameUIManager.m_ScreenControlUI.SetCameraPos(cameraPosition); m_GameUIManager.m_ScreenControlUI.SetCameraRot(cameraRotation); InitialStage(); //TODO get store index int storeIndex = -1; bool isLoad = false; m_SaveData = isLoad ? SaveManager.GetSaveDataStore(storeIndex) : SaveManager.GetSaveDataStore(); m_TurnCount = m_SaveData.m_TurnCount; if (m_SaveData.m_IsEmpty) { m_SaveData.m_IsEmpty = false; m_SaveData.m_Gold = m_PlayerGoldInit; m_SaveData.m_StageIndex = 1; m_SaveData.m_PlayerItems = m_ElementManager.GetInitItems(); m_SaveData.m_UserPlayerRecords = m_ElementManager.GetInitPlayerValue(); } m_PlayerDataManager.SetPlayerItemData(m_SaveData); StartGame(); m_StageMapManager.SetTileLineIsShow(true); m_GameUIManager.m_ScreenControlUI.SetPlayerUIShow(true); if (m_ScenarionManager.SetOpenScenarion()) { ChangeState(GameState.Scenarion); } else { m_GameUIManager.ShowStageInfo(); Debug.Log("No opening "); ScenationFin(true, false); } }
public static void SetSaveDataStore(SaveDataStore saveDataStore) { m_GameData.m_SaveDataStoreAuto = saveDataStore; }