Example #1
0
        public override void Hitted(Transform collisionObjectTransform)
        {
            if (_isAlive && !_isDefending)
            {
                _isAttacked = true;
                StartCoroutine(Backstep(1f));
                _health -= 10;
                BossHittedEvent.Trigger(_health);

                if (_health == 0)
                {
                    ScoreUpEvent.Trigger(_score);
                    Instantiate(_hittedEffect, collisionObjectTransform);
                    StartCoroutine(DestoySelf(true));
                }
            }
        }
Example #2
0
 public virtual void OnEvent(BossHittedEvent bossHittedEvent)
 {
     _bossHpUI.SetHealth(bossHittedEvent._bossHp);
 }