Ejemplo n.º 1
0
        public override float Run()
        {
            MainCamera mainCamera = KickStarter.mainCamera;

            mainCamera.RemoveSplitScreen();

            if (turnOff || runtimeCam1 == null || runtimeCam2 == null)
            {
                return(0f);
            }

            if (orientation == CameraSplitOrientation.Overlay)
            {
                mainCamera.SetBoxOverlay(runtimeCam1, runtimeCam2, overlayRect);
            }
            else
            {
                if (splitAmount1 + splitAmount2 > 1f)
                {
                    splitAmount2 = 1f - splitAmount1;
                }

                if (mainIsTopLeft)
                {
                    mainCamera.SetSplitScreen(runtimeCam1, runtimeCam2, orientation, mainIsTopLeft, splitAmount1, splitAmount2);
                }
                else
                {
                    mainCamera.SetSplitScreen(runtimeCam2, runtimeCam1, orientation, mainIsTopLeft, splitAmount1, splitAmount2);
                }
            }

            return(0f);
        }
Ejemplo n.º 2
0
        override public float Run()
        {
            MainCamera mainCamera = KickStarter.mainCamera;

            if (turnOff)
            {
                mainCamera.RemoveSplitScreen();
                return(0f);
            }

            if (cam1 == null || cam2 == null)
            {
                return(0f);
            }

            if (mainIsTopLeft)
            {
                mainCamera.SetSplitScreen(cam1, cam2, orientation, mainIsTopLeft, splitAmount1, splitAmount2);
            }
            else
            {
                mainCamera.SetSplitScreen(cam2, cam1, orientation, mainIsTopLeft, splitAmount1, splitAmount2);
            }

            return(0f);
        }