void LoadAndSetHighScore() { thisPlayerDataManager.SetFileIndex(0); if (!thisPlayerDataManager.PlayerDataIsLoaded()) { thisPlayerDataManager.Load(); } int highScore = thisPlayerDataManager.GetHighScore(); thisScoreManager.SetHighScore(highScore); thisPlayerDataManager.Save(); }
void SavePlayerData() { IPlayerDataManager manager = playerDataManagerAdaptor.GetPlayerDataManager(); manager.SetFileIndex(thisSelectedFileIndex); manager.Save(); }
void DrawFileSwitch(Rect rect) { if (thisSystemIsReady) { IPlayerDataManager playerDataManager = playerDataManagerAdaptor.GetPlayerDataManager(); string[] filePaths = playerDataManager.GetFilePaths(); string[] buttonTexts = CreateFilesNameArray(filePaths); int prevSelectedFileIndex = thisSelectedFileIndex; thisSelectedFileIndex = GUI.SelectionGrid( rect, thisSelectedFileIndex, buttonTexts, filePaths.Length ); if (thisSelectedFileIndex > filePaths.Length - 1) { thisSelectedFileIndex = filePaths.Length - 1; } if (thisSelectedFileIndex != prevSelectedFileIndex) { playerDataManager.SetFileIndex(thisSelectedFileIndex); } prevSelectedFileIndex = thisSelectedFileIndex; } else { GUI.Box( rect, "ready the system to load files" ); } }
void LoadPlayerData() { IPlayerDataManager manager = playerDataManagerAdaptor.GetPlayerDataManager(); manager.SetFileIndex(thisSelectedFileIndex); manager.Load(); CalculateShootingData(); }
void LoadAndFeedAllPanelsWithPlayerData() { thisPlayerDataManager.SetFileIndex(0); thisPlayerDataManager.Load(); int equippedBowIndex = thisPlayerDataManager.GetEquippedBowIndex(); IBowConfigData[] configDataArray = thisPlayerDataManager.GetBowConfigDataArray(); foreach (IBowPanel bowPanel in thisBowPanels) { int bowIndex = bowPanel.GetIndex(); IBowConfigData bowConfigData = configDataArray[bowIndex]; if (!bowConfigData.IsUnlocked()) { bowPanel.Lock(instantly: true); } else { bowPanel.Unlock(instantly: true); } if (bowIndex == equippedBowIndex) { bowPanel.SetEquippedness(isEquipped: true, instantly: true); } else { bowPanel.SetEquippedness(isEquipped: false, instantly: true); } int bowLevel = bowConfigData.GetBowLevel(); bowPanel.SetBowLevel(bowLevel, instantly: false); UpdateAttributePanel(bowPanel, bowConfigData); } UpdateUnlockButtons(); }