Пример #1
0
 public void Jump()
 {
     this.currentState = RPG_Animation.CharacterState.Jump;
     if (base.GetComponent <Animation>().IsPlaying("jump"))
     {
         base.GetComponent <Animation>().Stop("jump");
     }
     base.GetComponent <Animation>().CrossFade("jump");
 }
Пример #2
0
    public void SetCurrentState()
    {
        if (RPG_Controller.instance.characterController.isGrounded)
        {
            switch (this.currentMoveDir)
            {
            case RPG_Animation.CharacterMoveDirection.None:
                this.currentState = RPG_Animation.CharacterState.Idle;
                return;

            case RPG_Animation.CharacterMoveDirection.Forward:
                this.currentState = RPG_Animation.CharacterState.Walk;
                return;

            case RPG_Animation.CharacterMoveDirection.Backward:
                this.currentState = RPG_Animation.CharacterState.WalkBack;
                return;

            case RPG_Animation.CharacterMoveDirection.StrafeLeft:
                this.currentState = RPG_Animation.CharacterState.StrafeLeft;
                return;

            case RPG_Animation.CharacterMoveDirection.StrafeRight:
                this.currentState = RPG_Animation.CharacterState.StrafeRight;
                break;

            case RPG_Animation.CharacterMoveDirection.StrafeForwardLeft:
                this.currentState = RPG_Animation.CharacterState.Walk;
                return;

            case RPG_Animation.CharacterMoveDirection.StrafeForwardRight:
                this.currentState = RPG_Animation.CharacterState.Walk;
                return;

            case RPG_Animation.CharacterMoveDirection.StrafeBackLeft:
                this.currentState = RPG_Animation.CharacterState.WalkBack;
                return;

            case RPG_Animation.CharacterMoveDirection.StrafeBackRight:
                this.currentState = RPG_Animation.CharacterState.WalkBack;
                return;

            default:
                return;
            }
        }
    }