Exemplo n.º 1
0
        public override void Update(EnemyController controller)
        {
            Vector3 direction = controller.TargetPlayer.GetPostion - controller.GetEnemyPosition;

            direction.y = 0;
            controller.transform.rotation = Quaternion.Slerp(controller.transform.rotation, Quaternion.LookRotation(direction), 0.1f);
            if (direction.magnitude < 17 && !isAttacking)
            {
                isAttacking = true;
            }
            else if (!isAttacking)
            {
                controller.SwitchState(EnemyData.State.PURSUIT);
            }
        }
Exemplo n.º 2
0
        public override void Update(EnemyController controller)
        {
            Vector3 direction = controller.TargetPlayer.GetPostion - controller.GetEnemyPosition;

            direction.y = 0;
            controller.transform.rotation = Quaternion.Slerp(controller.transform.rotation, Quaternion.LookRotation(direction), 0.1f);
            if (direction.magnitude > 17)
            {
                controller.transform.Translate(0, 0, 0.2f);
            }
            else
            {
                controller.SwitchState(EnemyData.State.ATTACKING);
            }
        }
Exemplo n.º 3
0
 public virtual void Start(EnemyController controller)
 {
     controller.SwitchState(EnemyData.State.IDLE);
 }