protected virtual void hurt(IGetHurt hurter) { hurter.Hurt(Damage); Piercing--; if (Piercing < 0) { die(); } }
protected override void hurt(IGetHurt hurter) { var hits = Physics.OverlapSphere(transform.position, Radius); foreach (var hit in hits) { hit.attachedRigidbody?.GetComponent <IGetHurt>()?.Hurt(Damage); if (Slows) { var follower = hit?.attachedRigidbody?.GetComponent <Follower>(); if (follower) { follower.Slow(SlowDuration); } } } var visual = Instantiate(ExplosionVisualPrefab, transform.position, transform.rotation); visual.localScale = new Vector3(Radius, Radius, Radius); die(); }
protected virtual void hurt(IGetHurt hurter) { hurter.Hurt(Damage); }