예제 #1
0
        private void OnRenderImage(RenderTexture source, RenderTexture destination)
        {
            if (CheckResources() == false)
            {
                Graphics.Blit(source, destination);
                return;
            }

                        #if UNITY_WP8
            // WP8 has no OS support for rotating screen with device orientation,
            // so we do those transformations ourselves.
            if (Screen.orientation == ScreenOrientation.LandscapeLeft)
            {
                screenUv = new Vector4(0, -1, 1, 0);
            }
            if (Screen.orientation == ScreenOrientation.LandscapeRight)
            {
                screenUv = new Vector4(0, 1, -1, 0);
            }
            if (Screen.orientation == ScreenOrientation.PortraitUpsideDown)
            {
                screenUv = new Vector4(-1, 0, 0, -1);
            }
                        #endif

            OverlayMaterial.SetVector("_UV_Transform", screenUv);
            OverlayMaterial.SetColor("_OverlayTintColor", TintColor);
            OverlayMaterial.SetTexture("_OverlayTex", OverlayTexture);
            Graphics.Blit(source, destination, OverlayMaterial);
        }