void LoadAndSetHighScore() { thisPlayerDataManager.SetFileIndex(0); if (!thisPlayerDataManager.PlayerDataIsLoaded()) { thisPlayerDataManager.Load(); } int highScore = thisPlayerDataManager.GetHighScore(); thisScoreManager.SetHighScore(highScore); thisPlayerDataManager.Save(); }
void DrawBowControl(Rect rect) { if (thisSystemIsReady) { IPlayerDataManager playerDataManager = playerDataManagerAdaptor.GetPlayerDataManager(); if (playerDataManager.PlayerDataIsLoaded()) { //unlock, equip Rect sub_0 = GetHorizontalSubRect(rect, 0, 2); Rect sub_1 = GetHorizontalSubRect(rect, 1, 2); IBowConfigData bowConfigData = playerDataManager.GetBowConfigDataArray()[thisSelectedBowIndex]; bool isUnlocked = bowConfigData.IsUnlocked(); string lockToggleButtonText = isUnlocked ? "Lock" : "Unlock"; if (GUI.Button( sub_0, lockToggleButtonText )) { if (isUnlocked) { playerDataManager.LockBow(thisSelectedBowIndex); } else { playerDataManager.UnlockBow(thisSelectedBowIndex); } } int equippedBowIndex = playerDataManager.GetEquippedBowIndex(); if (equippedBowIndex == thisSelectedBowIndex) { GUI.Box( sub_1, "Equipped" ); } else { if (GUI.Button( sub_1, "Equip" )) { playerDataManager.SetEquippedBow(thisSelectedBowIndex); } } } else { GUI.Box( rect, "bow control\n" + "playerData not ready" ); } } }
void SetPlayerDataTutorialIsDone() { if (!thisPlayerDataManager.PlayerDataIsLoaded()) { thisPlayerDataManager.Load(); } thisPlayerDataManager.SetTutorialIsDone(); }
void DrawAttributeControl(Rect rect) { if (thisSystemIsReady) { IPlayerDataManager playerDataManager = playerDataManagerAdaptor.GetPlayerDataManager(); if (playerDataManager.PlayerDataIsLoaded()) { Rect sub_0 = GetHorizontalSubRect(rect, 0, 3); Rect sub_1 = GetHorizontalSubRect(rect, 1, 3); Rect sub_2 = GetHorizontalSubRect(rect, 2, 3); if (GUI.Button( sub_0, "Up" )) { int equippedBowIndex = playerDataManager.GetEquippedBowIndex(); IncreaseAttributeLevel( thisSelectedAttributeIndex ); CalculateShootingData(); } if (GUI.Button( sub_1, "Down" )) { int equippedBowIndex = playerDataManager.GetEquippedBowIndex(); DecreaseAttributeLevel( thisSelectedAttributeIndex ); CalculateShootingData(); } if (GUI.Button( sub_2, "Clear All" )) { ClearAllBowConfigData(); } } else { GUI.Box( rect, "attributeControl" + "\n" + "playerData not ready" ); } } }
/* 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); } } }
void SetInputScrollerAxisInversion() { IPlayerDataManager playerDataManager = playerDataManagerAdaptor.GetPlayerDataManager(); ICoreGameplayInputScroller inputScroller = coreGameplayInputScrollerAdaptor.GetInputScroller(); if (!playerDataManager.PlayerDataIsLoaded()) { playerDataManager.Load(); } for (int i = 0; i < 2; i++) { bool inverts = playerDataManager.GetAxisInversion(i); inputScroller.SetAxisInversion(i, inverts); } }
void SetVolume() { IAudioManager audioManager = audioManagerAdaptor.GetAudioManager(); IPlayerDataManager playerDataManager = playerDataManagerAdaptor.GetPlayerDataManager(); if (!playerDataManager.PlayerDataIsLoaded()) { playerDataManager.Load(); } float bgmVolume = playerDataManager.GetBGMVolume(); audioManager.SetBGMVolume(bgmVolume); float sfxVolume = playerDataManager.GetSFXVolume(); audioManager.SetSFXVolume(sfxVolume); }
public bool PlayerDataIsLoaded() { return(thisPlayerDataManager.PlayerDataIsLoaded()); }