public void SteelGold() { if (goldmine == null) { return; } goldmine.Withdraw(goldPenalty); }
public bool CreateTower(Tower tower, Vector3 position) { Goldmine goldmine = FindObjectOfType <Goldmine>(); if (goldmine == null) { return(false); } if (goldmine.CurrentBalance >= cost) { Instantiate(tower.gameObject, position, Quaternion.identity); goldmine.Withdraw(cost); return(true); } return(false); }