void DrawCurrencyControl(Rect rect) { if (thisSystemIsReady) { Rect sub_0 = GetHorizontalSubRect(rect, 0, 2); //set Rect sub_1 = GetHorizontalSubRect(rect, 1, 2); //add IPlayerDataManager playerDataManager = playerDataManagerAdaptor.GetPlayerDataManager(); if (GUI.Button( sub_0, "Set Currency" )) { playerDataManager.SetCurrency(currency); } if (GUI.Button( sub_1, "Add 100" )) { int currency = playerDataManager.GetCurrency(); int newCurrency = currency + 100; playerDataManager.SetCurrency(newCurrency); } } }
public void ActivateImple() { LoadAndFeedAllPanelsWithPlayerData(); int equippedBowIndex = thisPlayerDataManager.GetEquippedBowIndex(); thisBowPanelScroller.PlaceGroupElementUnderCursor(equippedBowIndex); if (!thisResourcePanel.IsShown()) //temp { thisResourcePanel.Show(); } int currency = thisPlayerDataManager.GetCurrency(); thisCurrencyPane.StartCurrencyUpdateProcess(currency); //temp foreach (IBowUnlockButton button in thisBowUnlockButtons) { int unlockCost = thisPlayerDataManager.GetBowUnlockCostArray()[button.GetPanelIndex()]; button.SetCostText(unlockCost); } thisBowConfigLabelPopText.Pop("Bow Customization", false); }
void MightWannaSaveDataHere(GameResultStats stats) { thisPlayerDataManager.SetFileIndex(0); if (!thisPlayerDataManager.PlayerDataIsLoaded()) { thisPlayerDataManager.Load(); } int currency = thisPlayerDataManager.GetCurrency(); int newCurrency = currency + stats.gainedCurrency + stats.scoreCurrencyBonus; thisPlayerDataManager.SetCurrency(newCurrency); int score = stats.score; int highScore = thisPlayerDataManager.GetHighScore(); if (score > highScore) { thisPlayerDataManager.SetHighScore(score); } thisPlayerDataManager.Save(); }