Ejemplo n.º 1
0
    private void updateAnimator()
    {
        /*animator.SetBool("jumping", this.jumping);
         * animator.SetBool("dashing", this.dashing);
         * animator.SetBool("onMovement",this.inMovement);
         * animator.SetBool("topHigh", this.topHigh);
         * animator.SetBool("onFloor", this.inFloor);
         */
        if (statePlayer.Equals(StatePlayer.Stunt))
        {
            animator.Play("Player_Stuned");
        }

        /*else
         * {
         *  animator.SetBool("isStunned", false);
         * }
         */
        if ((this.animator.GetCurrentAnimatorStateInfo(0).IsName("Player_Jump") && this.jumping || topHigh) && !inFloor)
        {
            //this.jumping = false;
            this.topHigh = true;
            animator.Play("Player_OnAir");
        }
        if ((Input.GetKeyDown(keyAttack) || isAttacking) && statePlayer != StatePlayer.Stunt && inFloor)
        {
            animator.Play("Player_Atack");
            this.isAttacking = true;
        }

        /*else if(this.animator.GetCurrentAnimatorStateInfo(0).IsName("Player_Atack"))
         * {
         *  animator.Play("Player_idle");
         *
         * }*/
    }