private void Update() { float f = Mathf.InverseLerp(0f, 2000f, force.magnitude); f = Mathf.Sqrt(f); float num = Vector3.Dot(boom.transform.right, force.normalized); num = Mathf.Clamp(num * 100f, -1f, 1f); float num2 = Mathf.Abs(Vector3.Dot(rhs: (wind - boom.GetPointVelocity(forcePoint.position)).normalized, lhs: boom.transform.right)); float num3 = Mathf.Sqrt(1f - num2 * num2); float time = ReplayRecorder.time; float num4 = lastFrameTime - time; lastFrameTime = time; phaseOpen += num4 * f * f * 100f; phaseFill += num4 * f * 5f; float value = num2 * num * f; float value2 = num3 * num * f; value = Smoothing.SmoothValue(smoothFill, value); value2 = Smoothing.SmoothValue(smoothOpen, value2); SetSignedShape(0, 150f * value + Mathf.Sin(phaseFill) * Mathf.Lerp(5f, 0f, f * 10f)); SetSignedShape(2, 150f * value2 + Mathf.Sin(phaseOpen) * Mathf.Lerp(10f, 5f, f)); if (sailSound != null) { sailSound.SetPitch(Mathf.Lerp(0.4f, 1.2f, f)); sailSound.SetVolume(Mathf.Lerp(0.2f, 1f, f)); } }
public void ReadInput(out float walkForward, out float walkRight, out float cameraPitch, out float cameraYaw, out float leftExtend, out float rightExtend, out bool jump, out bool playDead, out bool shooting) { Vector2 calc_joyLook = this.calc_joyLook; Vector2 calc_keyLook = this.calc_keyLook; Vector3 calc_joyWalk = this.calc_joyWalk; Vector3 calc_keyWalk = this.calc_keyWalk; if (calc_joyLook.sqrMagnitude > calc_keyLook.sqrMagnitude) { mouseControl = false; } if (calc_keyLook.sqrMagnitude > calc_joyLook.sqrMagnitude) { mouseControl = true; } if (calc_joyWalk.sqrMagnitude > calc_keyWalk.sqrMagnitude) { mouseControl = false; } if (calc_keyWalk.sqrMagnitude > calc_joyWalk.sqrMagnitude) { mouseControl = true; } cameraPitch = cameraPitchAngle; cameraYaw = cameraYawAngle; if (mouseControl) { cameraYaw += Smoothing.SmoothValue(mouseInputX, calc_keyLook.x); cameraPitch -= Smoothing.SmoothValue(mouseInputY, calc_keyLook.y); cameraPitch = Mathf.Clamp(cameraPitch, -80f, 80f); if (mouseLookMode == MouseLookMode.SpringBackNoGrab && !leftGrab && !rightGrab) { int num = 0; float num2 = 0.25f; cameraPitch = Mathf.Lerp(cameraPitch, num, num2 * 5f * Time.fixedDeltaTime); cameraPitch = Mathf.MoveTowards(cameraPitch, num, num2 * 30f * Time.fixedDeltaTime); } } else { cameraYaw += calc_joyLook.x * Time.deltaTime * 120f; if (verticalLookMode == VerticalLookMode.Relative) { if (Options.controllerInvert > 0) { calc_joyLook.y = 0f - calc_joyLook.y; } cameraPitch -= calc_joyLook.y * Time.deltaTime * 120f * 2f; cameraPitch = Mathf.Clamp(cameraPitch, -80f, 80f); } else { float num3 = -80f * lookYnormalized; bool flag = num3 * cameraPitch <0f || Mathf.Abs(num3)> Mathf.Abs(cameraPitch); float num4 = (!leftGrab && !rightGrab) ? 1f : Mathf.Abs(lookYnormalized); float num5 = (!leftGrab && !rightGrab) ? 0.25f : 0.0125f; float num6 = (!flag) ? num5 : num4; cameraPitch = Mathf.Lerp(cameraPitch, num3, num6 * 5f * Time.fixedDeltaTime * vScale); cameraPitch = Mathf.MoveTowards(cameraPitch, num3, num6 * 30f * Time.fixedDeltaTime * vScale); } } Vector3 vector = (!(calc_joyWalk.sqrMagnitude > calc_keyWalk.sqrMagnitude)) ? calc_keyWalk : calc_joyWalk; walkForward = vector.z; walkRight = vector.x; if (MenuSystem.keyboardState == KeyboardState.None) { leftExtend = GetLeftExtend(); rightExtend = GetRightExtend(); jump = GetJump(); playDead = GetUnconscious(); previousLeftExtend = leftExtend; previousRightExtend = rightExtend; shooting = GetFireworks(); } else { leftExtend = previousLeftExtend; rightExtend = previousRightExtend; jump = false; playDead = false; shooting = false; } }