void UpdateUpgradeUI() { //if there is an upgraded combo switch the image of that upgrade to a filled circle. for (int i = 0; i < m_AmountOfUpgrades; i++) { if (pData_.m_UnlockedCombinedCombos[i] == true) { m_CombinedComboImages[i].sprite = m_FilledJewel; } if (pData_.m_UnlockedProjectileCombos[i] == true) { m_ProjectileImages[i].sprite = m_FilledJewel; } if (pData_.m_UnlockedMeleeCombos[i] == true) { m_MeleeImages[i].sprite = m_FilledJewel; } } m_Health.text = "Player Health: " + pData_.m_PlayerHealth.ToString(); m_Speed.text = "Player Speed: " + pData_.m_MaxSpeed.ToString("F1"); //'F1' makes it one decimal m_Currency.text = "Currency Scalar: " + pData_.m_CurrencyScalar.ToString(); m_FireRate.text = "Fire Rate: " + pData_.m_FireRate.ToString("F1"); //'F1' makes it one decimal m_Damage.text = "Player Damage: " + pData_.m_PlayerDamage.ToString(); m_Punch.text = "Melee Damage: " + pData_.m_PunchDamage.ToString(); m_HealthCost.text = "Health: " + HealthCost.ToString() + " beans"; m_CurrencyCost.text = "Currency: " + CurrencyCost.ToString() + " beans"; m_FireRateCost.text = "Fire Rate: " + AttackRateCost.ToString() + " beans"; m_DamageCost.text = "P-Damage: " + DamageCost.ToString() + " beans"; m_PunchCost.text = "M-Damage: " + MeleeCost.ToString() + " beans"; m_SpeedCost.text = "Speed: " + SpeedCost.ToString() + " beans"; m_PComboCost.text = "P-Combo: " + projectileComboCost_[projectileCounter_].ToString() + " beans"; m_MComboCost.text = "M-Combo: " + meleeComboCost_[meleeCounter_].ToString() + " beans"; m_CComboCost.text = "C-Combo: " + multiComboCost_[combinedComboCounter_].ToString() + " beans"; m_PlayerMoney.text = "Player Beans: " + pData_.m_Currency.ToString(); }
public bool RemoveCurrency(CurrencyCost cost, float discount) { Currencies[cost.Type] -= Mathf.RoundToInt(cost.Amount * discount); return(true); }
public bool RemoveCurrency(CurrencyCost cost) { Currencies[cost.Type] -= cost.Amount; return(true); }
public bool CanPayPrice(CurrencyCost cost) { return(Currencies[cost.Type] >= cost.Amount); }
public CurrencyCost(CurrencyCost clone) { Type = clone.Type; Amount = clone.Amount; }
public bool CanPayPrice(CurrencyCost cost, float discount) { return(Currencies[cost.Type].amount >= cost.Amount * discount); }