public void Upgrade() { if (upgradeCost > m_playerLoot.GetSpendableLootCount()) { MessagePanelController.s_instance.SetText(s_kNoMoneyErrorMessage[(int)GameManager.s_instance.gameLanguage]); return; } m_playerUpgradeScript.UpgradeShip(); m_playerLoot.SpendLoot(upgradeCost); }
void Update() { if (m_inputField.text == string.Empty) { tradeCost = 0; tradeRevenue = 0; } else { int enterAmount = int.Parse(m_inputField.text); tradeCost = enterAmount * m_lootToBuyOneCannonball; tradeRevenue = enterAmount * m_lootFromSellOneCannonball; } m_costText.text = tradeCost.ToString(); m_revenueText.text = tradeRevenue.ToString(); m_cannonballOnHandNumber.text = m_playerCannon.cannonballCount.ToString(); m_lootOnHandNumber.text = m_playerLoot.GetSpendableLootCount().ToString(); }
public void Repair() { if (repairCost > m_playerLoot.GetSpendableLootCount()) { MessagePanelController.s_instance.SetText(s_kNoMoneyErrorMessage[(int)GameManager.s_instance.gameLanguage]); return; } if (m_playerShipHealth.healthPercentage >= 1f) { MessagePanelController.s_instance.SetText(s_kNoDamageErrorMessage[(int)GameManager.s_instance.gameLanguage]); return; } m_playerShipHealth.RecoverToFullHealth(); m_playerLoot.SpendLoot(repairCost); }