private bool onZoomCameraEvent(CinematographyEvents.ZoomCameraEvent evt) { bool flag = false; Director director = ClubPenguin.Core.SceneRefs.Get <Director>(); if (director != null) { flag = director.InCinematicContext; } if (!flag) { useCustomZoom = evt.State; if (useCustomZoom) { customZoom.ZoomOutDelay = evt.ZoomOutDelay; customZoom.ZoomPercentOnIdle = evt.ZoomPercentOnIdle; customZoom.ZoomPercentOnMove = evt.ZoomPercentOnMove; customZoom.HeightOffset = evt.HeightOffset; customZoom.MinDist = evt.MinDist; } else { wasCustomZoom = true; } } return(false); }
private void resetCamera() { if (!isCameraSetUp) { return; } if (playerPenguinGO != null) { playerPenguinGO.transform.rotation = previousPenguinRotation; } if (Camera.main != null) { CameraCullingMaskHelper.ShowLayer(Camera.main, "RemotePlayer"); } GameObject gameObject = GameObject.FindWithTag(UIConstants.Tags.UI_Chat); if (gameObject != null) { Canvas[] componentsInChildren = gameObject.GetComponentsInChildren <Canvas>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = true; } } Service.Get <EventDispatcher>().DispatchEvent(default(BlobShadowEvents.EnableBlobShadows)); if (isZoomSetup) { CinematographyEvents.ZoomCameraEvent evt = new CinematographyEvents.ZoomCameraEvent(state: false); Service.Get <EventDispatcher>().DispatchEvent(evt); isZoomSetup = false; } }
private void focusCameraOnPenguin() { playerPenguinGO = ClubPenguin.SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject; if (playerPenguinGO == null) { return; } CameraCullingMaskHelper.HideLayer(Camera.main, "RemotePlayer"); GameObject gameObject = GameObject.FindWithTag(UIConstants.Tags.UI_Chat); if (gameObject != null) { Canvas[] componentsInChildren = gameObject.GetComponentsInChildren <Canvas>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } } Service.Get <EventDispatcher>().DispatchEvent(new BlobShadowEvents.DisableBlobShadows(includeLocalPlayerShadow: false)); previousPenguinRotation = playerPenguinGO.transform.rotation; Vector3 vector = Camera.main.transform.position - playerPenguinGO.transform.position; playerPenguinGO.transform.rotation = Quaternion.LookRotation(new Vector3(vector.x, 0f, vector.z)); CinematographyEvents.ZoomCameraEvent evt = new CinematographyEvents.ZoomCameraEvent(state: true, ZoomPercentage, ZoomPercentage, 0f, ZoomHeightOffset, ZoomMinDist); Service.Get <EventDispatcher>().DispatchEvent(evt); isZoomSetup = true; isCameraSetUp = true; }
private void changeToZoomedCamera() { float num = 0.5f; float heightOffset = 1f; float minDist = 1.5f; CinematographyEvents.ZoomCameraEvent evt = new CinematographyEvents.ZoomCameraEvent(state: true, num, num, 0f, heightOffset, minDist); Service.Get <EventDispatcher>().DispatchEvent(evt); }
private void changeToDefaultCamera() { CinematographyEvents.ZoomCameraEvent evt = new CinematographyEvents.ZoomCameraEvent(state: false); Service.Get <EventDispatcher>().DispatchEvent(evt); }