private void OnTriggerEnter(Collider other) { if (target && other.gameObject == target.gameObject) { target.Damage(source, damage); Destroy(gameObject); } }
private IEnumerator Attack() { if (castTime > .0F) { yield return(new WaitForSeconds(castTime)); } target.Damage(owner.GetComponent <Targetable>(), damage); if (cooldown > .0F) { yield return(new WaitForSeconds(cooldown)); } isDone = true; }