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(); }
/* Data Manipulation */ public void TrySetEquippedBow(int index) { if (!thisPlayerDataManager.PlayerDataIsLoaded()) { thisPlayerDataManager.Load(); } int prevEquippedBowIndex = thisPlayerDataManager.GetEquippedBowIndex(); if (prevEquippedBowIndex != index) { IBowConfigData configData = thisPlayerDataManager.GetBowConfigDataArray()[index]; if (configData.IsUnlocked()) { thisPlayerDataManager.SetEquippedBow(index); thisPlayerDataManager.Save(); IBowPanel panelToEquip = thisBowPanels[index]; IBowPanel panelToUnequip = thisBowPanels[prevEquippedBowIndex]; panelToEquip.SetEquippedness(true, false); panelToUnequip.SetEquippedness(false, false); } } }
public void SavePlayerData() { thisPlayerDataManager.Save(); }