So far there is no errors and the text displays properly on the GUI but it only displays the starting amount even though I have a Coroutine that updates that amount, heres what I have so far(c#):
public class Money : MonoBehaviour {
public float cashInInventory = 100;
public float cashEarnAmount = 50;
public Text spendingCash;
void Start () {
spendingCash = GetComponent<Text>();
StartCoroutine("GiveCash");
}
private IEnumerable GiveCash()
{
while (true)
{
yield return new WaitForSeconds(5.0f);
cashInInventory += cashEarnAmount;
}
}
// Update is called once per frame
void Update () {
spendingCash.text = cashInInventory.ToString("f0");
print(cashInInventory);
}
}