예제 #1
0
 public void OnTransition(State previousState, DaleStateHandler daleStateHandler)
 {
     if (previousState.Equals(daleStateHandler.grabbingLedgeState))
     {
         daleStateHandler.gravityHandler.enabled = true;
         daleStateHandler.animator.SetBool("climbLedge", false);
     }
 }
예제 #2
0
        public State DuringState(DaleStateHandler daleStateHandler)
        {
            KeyboardController keyboardController = daleStateHandler.keyboardController;

            if (keyboardController.isJumpKeyPressed)
            {
                return(daleStateHandler.jumpingState);
            }
            return(this);
        }
예제 #3
0
 public State DuringState(DaleStateHandler daleStateHandler)
 {
     if (daleStateHandler.characterController.isGrounded)
     {
         return(daleStateHandler.walkingState);
     }
     if (daleStateHandler.ledgeDetectionState.isThereWall && daleStateHandler.ledgeDetectionState.isThereSpaceToClimb)
     {
         return(daleStateHandler.grabbingLedgeState);
     }
     return(this);
 }
예제 #4
0
        public void OnTransition(State previousState, DaleStateHandler daleStateHandler)
        {
            Animator            animator            = daleStateHandler.animator;
            ThirdPersonMovement thirdPersonMovement = daleStateHandler.thirdPersonMovement;
            GravityHandler      gravityHandler      = daleStateHandler.gravityHandler;

            gravityHandler.Jump();
            Debug.Log("jumping transition");
            animator.SetBool("jump", true);
            animator.SetBool("run", false);
            animator.SetBool("movingBackward", false);
            thirdPersonMovement.enabled = false;
        }
예제 #5
0
 public State DuringState(DaleStateHandler daleStateHandler)
 {
     if (grabbingAnimationFinished && daleStateHandler.keyboardController.isJumpKeyPressed)
     {
         grabbingAnimationFinished = false;
         daleStateHandler.animator.SetBool("climbLedge", true);
         daleStateHandler.animator.SetBool("isGrabbing", false);
     }
     if (climbingAnimationFinished)
     {
         climbingAnimationFinished = false;
         return(daleStateHandler.walkingState);
     }
     return(this);
 }
예제 #6
0
 public void OnTransition(State previousState, DaleStateHandler daleStateHandler)
 {
     daleStateHandler.animator.SetBool("isGrabbing", true);
     daleStateHandler.gravityHandler.enabled = false;
     daleStateHandler.gravityHandler.StopJump();
 }