public override void NextState(Enemy enemy, float deltaTime, Player player) { if (enemy.HP <= 0) { enemy.OnDead(); enemy.SetState(Enemy.DEAD_STATE); return; } Transform enemyTransform = enemy.GetTransform(); Hunter hunter = enemy as Hunter; if (hunter != null) { if (hunter.Jump(deltaTime)) { hunter.SetState(Hunter.IDLE_STATE); } else { if (!hunter.JumpEnded) { hunter.Animate(AnimationName.ENEMY_JUMPING, WrapMode.Loop); } } } }
public override void NextState(Enemy enemy, float deltaTime, Player player) { if (enemy.HP <= 0) { enemy.OnDead(); enemy.SetState(Enemy.DEAD_STATE); return; } Hunter hunter = enemy as Hunter; enemy.Animate(AnimationName.ENEMY_IDLE, WrapMode.Loop); enemy.GetTransform().LookAt(player.GetTransform()); //hunter.Patrol(deltaTime); if (hunter.LookAroundTimOut()) { if (hunter.ReadyForJump()) { int rnd = Random.Range(0, 100); if (rnd < 100) { hunter.StartJump(); hunter.SetState(Hunter.JUMP_STATE); } else { hunter.SetState(Hunter.CATCHING_STATE); } } else { hunter.SetState(Hunter.CATCHING_STATE); } } }