private void Start() { this.m_position.camRotation.x = this.m_camStartRotationX; this.m_position.camRotation.y = this.m_camStartRotationY; this.m_position.camDistance = this.m_camStartDistance; this.m_position.forwardAmount = Vector3.zero; this.m_target = this.m_position; this.m_previousPos = this.Ship.transform.position; }
private void InterpolateToTarget() { if (this.disableInterpolation || Time.timeScale == 0f) { this.m_position = this.m_target; return; } float num = 1f / Mathf.Clamp(this.camSmoothness, 0.01f, 1f); float t = Mathf.Clamp01(Time.deltaTime * num); num = 1f / Mathf.Clamp(this.shipSmoothness, 0.01f, 1f); float t2 = Mathf.Clamp01(Time.deltaTime * num); this.m_position.camDistance = Mathf.Lerp(this.m_position.camDistance, this.m_target.camDistance, t); this.m_position.camRotation = Vector2.Lerp(this.m_position.camRotation, this.m_target.camRotation, t); this.m_position.forwardAmount = Vector3.Lerp(this.m_position.forwardAmount, this.m_target.forwardAmount, t2); this.m_position.turnAmount = Mathf.Lerp(this.m_position.turnAmount, this.m_target.turnAmount, t2); }