void FixedUpdate() { if (allowGen && Time.time - timeOfLastGen > timeBetweenGoldGen) { baseStats.AddMoney(amountToGen); timeOfLastGen = Time.time; } }
public void TakeDamage(int damage) { health -= damage; if (health <= 0) { baseStats.AddMoney(moneyDrop); Destroy(gameObject); } }
void Update() { if (selected && Input.GetMouseButtonUp(0)) { GameObject tower = GameObject.FindGameObjectWithTag("Ghost"); try { baseStats.AddMoney(tower.GetComponent <GhostTowerDragger> ().GetCost()); Destroy(tower); } catch { } } }