public void OnTriggerStay(Collider collider) { GameObject other = collider.gameObject; Donut donut = other.GetComponent <Donut> (); if (donut != null) { donut.TakeDamage(this.damage); } }
/* Hal Assisted Code*/ public IEnumerator Fire(Donut donut) { if (donut != null) { donut.TakeDamage(this.damage); ableToFire = false; Debug.Log("BOOM"); yield return(new WaitForSeconds(atkSpeed)); Debug.Log("RELOAD"); ableToFire = true; } }