private void Update()
 {
     if (_boss.CurrentState is DiveState && Physics2D.OverlapCollider(_collider, _contactFilter2D, _collidersBuffer) > 0)
     {
         // todo fx, etc...
         SlowMotionFx.Freeze();
         Destroy(gameObject);
     }
 }
    public void Hit(HitInfo hitInfo)
    {
        if (_hits.Contains(hitInfo.Id))
        {
            return;
        }

        _hitRemaining = Mathf.Max(0, _hitRemaining - hitInfo.Damage);
        _hits.Add(hitInfo.Id);

        SlowMotionFx.Freeze();

        if (_hitRemaining <= 0)
        {
            DestroyTarget();
        }
        else if (HitEvent != null)
        {
            HitEvent();
        }
    }
Esempio n. 3
0
 public void AccountDamages(int amount, GameObject source)
 {
     CurrentHitCount = Mathf.Max(0, CurrentHitCount - amount);
     OnHitEvent(this, source);
     SlowMotionFx.Freeze();
 }