public void OnTransition(State previousState, DaleStateHandler daleStateHandler) { if (previousState.Equals(daleStateHandler.grabbingLedgeState)) { daleStateHandler.gravityHandler.enabled = true; daleStateHandler.animator.SetBool("climbLedge", false); } }
public State DuringState(DaleStateHandler daleStateHandler) { KeyboardController keyboardController = daleStateHandler.keyboardController; if (keyboardController.isJumpKeyPressed) { return(daleStateHandler.jumpingState); } return(this); }
public State DuringState(DaleStateHandler daleStateHandler) { if (daleStateHandler.characterController.isGrounded) { return(daleStateHandler.walkingState); } if (daleStateHandler.ledgeDetectionState.isThereWall && daleStateHandler.ledgeDetectionState.isThereSpaceToClimb) { return(daleStateHandler.grabbingLedgeState); } return(this); }
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; }
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); }
public void OnTransition(State previousState, DaleStateHandler daleStateHandler) { daleStateHandler.animator.SetBool("isGrabbing", true); daleStateHandler.gravityHandler.enabled = false; daleStateHandler.gravityHandler.StopJump(); }