// Token: 0x060018AD RID: 6317 RVA: 0x00084340 File Offset: 0x00082540 public void ApplyForce(Vector3 v, CharacterMoveController.ForceType type) { if (this.useNewMethod) { this._externalForce = v * 0.035f * this.initialDamp; } else { this._externalForce = v * 0.035f; } this._externalForceType = type; this._hasExternalForce = true; this._externalForceTime = Time.realtimeSinceStartup + 4f; }
// Token: 0x060018AE RID: 6318 RVA: 0x000843AC File Offset: 0x000825AC private void UpdateMovement() { this.CheckDuck(); if (GameState.Current.PlayerData.Is(MoveStates.Flying)) { this.FlyInAir(); } else if (this.WaterLevel > 2) { this.MoveInWater(); } else if (this._isOnLatter) { this.MoveOnLadder(); } else if (this.IsGrounded) { this.MoveOnGround(); } else if (this.WaterLevel == 2) { this.MoveOnWaterRim(); } else { this.MoveInAir(); } if (this._hasExternalForce) { if (this.useNewMethod) { if (this._externalForceType != CharacterMoveController.ForceType.None) { this._velocity = Vector3.zero; this._canJump = false; this._ungroundedCount = 6; GameState.Current.PlayerData.JumpingUpdate(); } this._velocity += this._externalForce; this._externalForce *= this.dynamicDamp; this._hasExternalForce = (this._externalForce.sqrMagnitude > 0.01f); this._externalForceType = CharacterMoveController.ForceType.None; } else { CharacterMoveController.ForceType externalForceType = this._externalForceType; if (externalForceType != CharacterMoveController.ForceType.Additive) { if (externalForceType == CharacterMoveController.ForceType.Exclusive) { this._velocity = this._externalForce; } } else { this._velocity = Vector3.Scale(this._velocity, new Vector3(1f, 0.5f, 1f)) + this._externalForce; } this.Jump(this._velocity.y); this._externalForce = Vector2.zero; this._hasExternalForce = false; } } this._velocity[1] = Mathf.Clamp(this._velocity[1], -150f, 150f); this._collisionFlag = this._controller.Move(this._velocity * Time.fixedDeltaTime); this._velocity = this._controller.velocity; bool flag = (this._collisionFlag & CollisionFlags.Below) != CollisionFlags.None; if (flag) { this._externalForceTime = 0f; } if (this._externalForceTime < Time.realtimeSinceStartup) { Vector3 to = this.ClampHorizontally(this._velocity, 22.8f); this._velocity = Vector3.Lerp(this._velocity, to, Time.fixedDeltaTime * 3f); } GameState.Current.PlayerData.Velocity = this._velocity; if (flag) { if (this._ungroundedCount > 5 && this.CharacterLanded != null) { this.CharacterLanded(this._velocity.y); GameState.Current.PlayerData.LandingUpdate(); } this._ungroundedCount = 0; this.IsGrounded = true; } else if (!this._canJump) { this._ungroundedCount++; this.IsGrounded = false; } else if (this._ungroundedCount > 5) { this.IsGrounded = false; } else { this._ungroundedCount++; this.IsGrounded = true; } GameState.Current.PlayerData.Set(MoveStates.Grounded, this.IsGrounded); if (this.IsGrounded) { GameState.Current.PlayerData.Set(MoveStates.Jumping, false); } }