public void SetCameraFeel(CameraFeel feel) { float m; float k; if (feel != CameraFeel.Slow) { if (feel != CameraFeel.Medium) { m = 1f; k = 180f; } else { m = 10f; k = 120f; } } else { m = 150f; k = 20f; } this.physicalCamera.SetSpring(m, k); this.lookatPoint.SetSpring(m, k); }
public void SetRotationFeel(CameraFeel feel) { float m; float k; if (feel != CameraFeel.Slow) { if (feel != CameraFeel.Medium) { m = 1f; k = 180f; } else { m = 10f; k = 120f; } } else { m = 150f; k = 20f; } this.rotationSpring.SetSpring(m, k); }
private void SetVantage(bool topDown, CameraFeel cameraFeel, bool reset, bool keepFocus, Vector3 focus) { MainCamera mainCamera = Service.Get <CameraManager>().MainCamera; float num = 200f; float num2 = -num; float num3 = -num; if (topDown) { num2 *= 0.6f; num3 *= 0.6f; } this.SetYToHypotenuse(Mathf.Sqrt(1f + (num2 * num2 + num3 * num3) / (num * num))); num = Mathf.Sqrt(3f * num * num - num2 * num2 - num3 * num3); if (!reset) { num2 += mainCamera.CurrentLookatAnchor.x; num3 += mainCamera.CurrentLookatAnchor.z; } mainCamera.AnchorCamera(new Vector3(num2, num, num3)); if (cameraFeel != CameraFeel.NoChange) { mainCamera.SetCameraFeel(cameraFeel); } if (reset) { mainCamera.AnchorLookat(Vector3.zero); } if (keepFocus) { mainCamera.KeepFocus(focus); } if (this.mapManipulator != null) { this.mapManipulator.OnVantageSwitch(topDown); } }
public void SetIsoVantage(CameraFeel cameraFeel) { this.SetVantage(false, cameraFeel, true, false, Vector3.zero); }