Exemplo n.º 1
0
 public virtual void Die()
 {
     CanBeDamaged = false;
     IsDead       = true;
     CancelInvoke();
     NavEntity.DisableMoving();
     DisableSkill();
     DisablePowerUp();
     _animator.SetInteger("state", (int)AnimationStates.Dead);
 }
Exemplo n.º 2
0
        public override void Initialize(int x, int y)
        {
            base.Initialize(x, y);

            CanBeDamaged = false;
            IsDead       = false;
            CancelInvoke();
            NavEntity.DisableMoving();
            DisablePowerUp();
            _animator.SetInteger("state", (int)AnimationStates.Idle);
            MovementDirection = MovementDirections.Left;
            NavEntity.SetSpeed(GameController.Instance.PLAYER_DEFAULT_SPEED);
        }
Exemplo n.º 3
0
 protected virtual void Die()
 {
     NavEntity.DisableMoving();
     ActionState  = EnemyActionState.Dead;
     CanBeDamaged = false;
     CanDamage    = false;
     IsDead       = true;
     _animator.SetInteger("state", (int)AnimationStates.Dead);
     Invoke("RecoverFromDeathAnimation", GameController.Instance.DEATH_ANIMATION_INTERVAL);
     GameEvents.Instance.OnEnemyDead(new GameEvents.OnEnemyDeadEventArgs {
         EnemyType = EnemyType
     });
 }
Exemplo n.º 4
0
        public override void Initialize(int x, int y)
        {
            base.Initialize(x, y);

            ActionState  = EnemyActionState.Waiting;
            Life         = GameController.Instance.MEDIUM_LIFE;
            IsDead       = false;
            CanBeDamaged = false;
            CanDamage    = false;
            _animator.SetInteger("state", (int)AnimationStates.Idle);
            NavEntity.SetSpeed(GameController.Instance.ENEMY_MEDIUM_SPEED);
            NavEntity.DisableMoving();
            CancelInvoke();
        }
Exemplo n.º 5
0
        protected virtual void ReceiveDamage()
        {
            if (!CanBeDamaged)
            {
                return;
            }

            Life--;
            if (Life == 0)
            {
                Die();
            }
            else
            {
                NavEntity.DisableMoving();
                CanBeDamaged = false;
                CanDamage    = false;
                _animator.SetInteger("state", (int)AnimationStates.Hurt);
                Invoke("RecoverFromDamage", GameController.Instance.RECOVER_INVERVAL);
            }
        }