public override void OnStateEnter(MyMovementState previousState) { _currentChargeVelocity = KinematicCharacterMotor.CharacterTransform.forward * ChargeSpeed; _isStopped = false; _timeSinceStartedCharge = 0f; _timeSinceStopped = 0f; }
public override void OnStateEnter(MyMovementState previousState) { KinematicCharacterMotor.HandlePhysics(false, true); _climbingState = ClimbingState.Anchoring; // Store the target position and rotation to snap to _targetPosition = ActiveLadder.ClosestPointOnLadderSegment(KinematicCharacterMotor.TransientPosition, out _onLadderSegmentState); _targetRotation = ActiveLadder.transform.rotation; }
/// <summary> /// Handles movement state transitions and enter/exit callbacks /// </summary> public void TransitionToState(MyMovementState newState) { newState.AssignedCharacterController = this; newState.KinematicCharacterMotor = this.KinematicCharacterMotor; if (CurrentMovementState != null) { CurrentMovementState.OnStateExit(newState); } MyMovementState prevState = CurrentMovementState; CurrentMovementState = newState; CurrentMovementState.OnStateEnter(prevState); }
public override void OnStateExit(MyMovementState nextState) { }
public override void OnStateEnter(MyMovementState previousState) { }
public override void OnStateExit(MyMovementState nextState) { KinematicCharacterMotor.HandlePhysics(true, true); }
public abstract void OnStateEnter(MyMovementState previousState);
public abstract void OnStateExit(MyMovementState nextState);
public override void OnStateEnter(MyMovementState previousState) { KinematicCharacterMotor.HandlePhysics(false, false); }