Ejemplo n.º 1
0
    // Fixed update because the Enemy can
    void FixedUpdate()
    {
        animator     = GetComponent <Animator> () as Animator;
        isAggressive = EnemyMovement.calculateDistance(tr, player.transform);

        if (isAggressive)
        {
            // Moving
            Move();

            // Attacking
            if (!isInCooldown)
            {
                // TODO: adjust attack direction to the one of the player
                Attack();
            }
        }

        EnemyAnimation.Animate(animator, isAggressive, isFacingRight, isFacingUp, lookingHorizontal);
    }
Ejemplo n.º 2
0
 //create to accomodate animation differences among the enemies.
 void Animate()
 {
     EnemyAnimation.Animate(false, anim, rb, isGrounded, false, health.IsDead()); // apply animations
 }
Ejemplo n.º 3
0
 //create to accomodate animation differences among the enemies.
 protected virtual void Animate()
 {
     EnemyAnimation.Animate(isMoving(), anim, rb, isGrounded, isAttacking, health.IsDead()); // apply animations
 }