public void BuyMinion() { if (_gm.User.MinionIsInInvetory(_popup.selected)) { return; } var currency = _gm.User.Currency; var minionValue = _storeInfoData[_popup.selected].currencyValue; var dif = currency - minionValue; if (dif < 0) { //Debug.Log("You don't have currency for this buy."); return; } SoundManager.instance.PlaySound(SoundFxNames.upgrade_success); _gm.User.BuyMinion(_popup.selected, minionValue); //Call again to refresh data. UpdatePopupVisualData(true); _popup.CheckBuyButton(false, true); _popup.SelectMinionByCode(_popup.selected); }
public void BuyMinion() { if (_gm.User.MinionIsInInvetory(_popup.selected)) { return; } var currency = _gm.User.Currency; var minionValue = _storeInfoData[_popup.selected].currencyValue; var dif = currency - minionValue; if (dif < 0) { Debug.Log("You don't have currency for this buy."); return; } _gm.User.BuyMinion(_popup.selected, minionValue); //Call again to refresh data. OnPopupDisplayCallback(); _popup.CheckBuyButton(false, true); }