コード例 #1
0
    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);
    }
コード例 #2
0
    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;
        }
    }
コード例 #3
0
    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;
    }
コード例 #4
0
        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);
        }
コード例 #5
0
 private void changeToDefaultCamera()
 {
     CinematographyEvents.ZoomCameraEvent evt = new CinematographyEvents.ZoomCameraEvent(state: false);
     Service.Get <EventDispatcher>().DispatchEvent(evt);
 }