public override void SetZoom(int level) { base.SetZoom(level); if (level >= 0 && level < maxZoomLevel) { if (level == 0) { //onEnterMaxZoomOut.Invoke(); } else if (zoomLevel == 0) { //onExitMaxZoomOut.Invoke(); } Services.eventManager.Fire(new ZoomEvent(level - zoomLevel)); zoomLevel = level; targetCameraAttr = zoomLevelAttrs[zoomLevel]; targetAngle = targetCameraAttr.angleZero; origTranslate = targetCameraAttr.translateZero; pivots.transform.position = origTranslate; ResetTranslate(); cameraSpeed = zoomCameraSpeed; } }
private void Start() { StartCoroutine(InitDelay(startDelay)); zoomLevel = defaultZoomLevel; targetCameraAttr = zoomLevelAttrs[zoomLevel]; targetAngle = targetCameraAttr.angleZero; origTranslate = targetCameraAttr.translateZero; targetTranslate = origTranslate; if (!startWithZoom) { pivots.transform.position = origTranslate; freeLookCam.m_XAxis.Value = targetAngle.x; freeLookCam.m_YAxis.Value = targetAngle.y / 180f; freeLookCam.m_Orbits[0] = new CinemachineFreeLook.Orbit(targetCameraAttr.topRigOrbit.x, targetCameraAttr.topRigOrbit.y); freeLookCam.m_Orbits[1] = new CinemachineFreeLook.Orbit(targetCameraAttr.middleRigOrbit.x, targetCameraAttr.middleRigOrbit.y); freeLookCam.m_Orbits[2] = new CinemachineFreeLook.Orbit(targetCameraAttr.bottomRigOrbit.x, targetCameraAttr.bottomRigOrbit.y); } inited = false; freeLookCam.enabled = false; if (isRecording) { RecordFrameToFile(null, 1f); } }
public override void ResumeZoom() { base.ResumeZoom(); FreeLookCamAttr attr = zoomLevelAttrs[zoomLevel]; targetCameraAttr.middleRigOrbit = attr.middleRigOrbit; targetCameraAttr.topRigOrbit = attr.topRigOrbit; targetCameraAttr.bottomRigOrbit = attr.bottomRigOrbit; }