private void CommitDive() { if (ANIMATION_DATA.PlayTime < DiveTime) { return; } if (ANIMATION_DATA.PlayTime > RollTime) { return; } CONTROL_MECHANISM.RIGIDBODY.useGravity = true; CONTROL_MECHANISM.TriggerColliderControl(DynamicColliderType.DEFAULT); if (IsDiving) { if (!StopAnimationTriggered) { StopAnimationTriggered = true; ANIMATION_DATA.StopAnimation(); } UpdateFallTilt(); } }
public override void ClearState() { CONTROL_MECHANISM.RIGIDBODY.useGravity = true; IsDiving = false; DiveChecked = false; StopAnimationTriggered = false; CONTROL_MECHANISM.TriggerColliderControl(DynamicColliderType.DEFAULT); }
public override void InitState() { ANIMATION_DATA.DesignatedAnimation = PlayerState.JumpOver.ToString(); IsDiving = false; StopAnimationTriggered = false; CONTROL_MECHANISM.RIGIDBODY.useGravity = false; CONTROL_MECHANISM.RIGIDBODY.AddForce(Vector3.up * 17.5f); CONTROL_MECHANISM.TriggerColliderControl(DynamicColliderType.JumpOver); }
private void Roll() { //check for ground collision if (!ANIMATION_DATA.AnimationIsPlaying()) { if (move.IsGoingToLand() || MOVEMENT_DATA.IsGrounded) { CONTROL_MECHANISM.ClearVelocity(); ANIMATION_DATA.PlayAnimation(); } } //resume normal play if (ANIMATION_DATA.PlayTime >= RollTime) { SetDefaultTilt(); move.MoveForward(MOVEMENT_DATA.RunSpeed * 0.9f, CHARACTER_TRANSFORM.rotation.eulerAngles.y); CONTROL_MECHANISM.TriggerColliderControl(DynamicColliderType.DEFAULT); } }