Exemplo n.º 1
0
    public void animate()
    {
        //if velocity > .5 play run animation
        //else play idle animation
        if (!Player.isAttacking)
        {
            if (navAgent.velocity.magnitude > 0.5f)
            {
                animation.Play(runAnimation.name);
            }
            else if (Input.GetKeyUp(KeyCode.Space))
            {
                audio.Play(2);
                animation[attackAnimation.name].speed = 3f;
                animation.Play(attackAnimation.name);

                enemHealth.GetHit(damage);
            }
            else
            {
                animation.PlayQueued(idleAnimation.name);
            }

            //else
            //	animation.CrossFade (idleAnimation.name);
        }
    }