private IEnumerator StartMining() { animator.Play("Attack"); while (true) { // play animation var position = transform.position; position.Set(position.x, position.y + HEIGHT_OFFSET, position.z); var text_holder = Instantiate(dmgTakenText, position, Quaternion.identity); text_holder.transform.GetChild(0).GetComponent <TextMeshPro>().SetText("+ " + _unitData.Reward); goldController.AddBalance(_unitData.Reward); yield return(new WaitForSeconds(2f)); } }
public void RemoveUnit(Unit unit) { _goldController.AddBalance(unit.GetUnitReward()); _spawnedUnits.Remove(unit); }