Esempio n. 1
0
        public override void Initialize(SplitScreenManager manager, Material split)
        {
            base.Initialize(manager, split);

            // camera orientation
            worldUp = -Vector3.forward;
            cameraDistanceVector = worldUp * SplitScreenManager.CameraDistance;
        }
Esempio n. 2
0
        private void InitializeRenderTexture(int width, int height)
        {
            renderTexture = new RenderTexture(width, height, SplitScreenManager.Instance.Is3D ? 24 : 0);

            int msaa = SplitScreenManager.GetAntialiasingLevel();

            if (msaa > 1)
            {
                renderTexture.antiAliasing = msaa;
            }

            Camera.targetTexture = renderTexture;
        }
        public virtual void Initialize(SplitScreenManager manager, Material split)
        {
            splitManager      = manager;
            splitScreenCamera = SplitScreenManager.MainCamera;
            splitScreenMat    = split;

            screenX     = SplitScreenManager.ScreenWidth;
            screenY     = SplitScreenManager.ScreenHeight;
            aspectRatio = (float)screenX / screenY;

            splitManager.OnResolutionChanged += (x, y) =>
            {
                screenX     = x;
                screenY     = y;
                aspectRatio = (float)x / y;
            };

            splitManager.OnResolutionChanged += CreateRenderTextures;
            CreateRenderTextures(SplitScreenManager.ScreenWidth, SplitScreenManager.ScreenHeight);
        }