public void UpdateItem(Product _p) { float inventory = Inventory.Instance.m_Inventory[_p]; float balance = Inventory.Instance.m_ProductionBalance[_p]; if (inventory <= 0) { m_InventoryAmount.color = Color.red; } else { m_InventoryAmount.color = Color.black; } m_InventoryAmount.text = UIManager.ConvertFloatToStringDigit(inventory); m_Balance.text = UIManager.ConvertFloatToStringDigitWithSign(balance, out Color c); m_Balance.color = c; UpdateIncome(); }
private void SetCurrProduction(float _amount) { string sign = ""; if (_amount < 0) { m_CurrProduction.color = Color.red; } else if (_amount == 0) { m_CurrProduction.color = Color.yellow; sign = ""; } else { m_CurrProduction.color = Color.black; sign = "+"; } m_CurrProduction.text = sign + " " + UIManager.ConvertFloatToStringDigit(_amount); }