Ejemplo n.º 1
0
 protected virtual void hurt(IGetHurt hurter)
 {
     hurter.Hurt(Damage);
     Piercing--;
     if (Piercing < 0)
     {
         die();
     }
 }
Ejemplo n.º 2
0
    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();
    }
Ejemplo n.º 3
0
 protected virtual void hurt(IGetHurt hurter)
 {
     hurter.Hurt(Damage);
 }