示例#1
0
 private void CameraPreCull(Camera camera)
 {
     if ((camera.depthTextureMode & DepthTextureMode.Depth) == DepthTextureMode.None)
     {
         camera.depthTextureMode |= DepthTextureMode.Depth;
     }
     CurrentCamera         = camera;
     CurrentCameraPosition = camera.transform.position;
     SetShaderSunViewportPosition(camera);
     CurrentCameraFrustumPlanes = GeometryUtility.CalculateFrustumPlanes(camera);
     if (RainScript != null && RainScript.isActiveAndEnabled)
     {
         RainScript.PreCullCamera(camera);
     }
     if (SnowScript != null && SnowScript.isActiveAndEnabled)
     {
         SnowScript.PreCullCamera(camera);
     }
     if (HailScript != null && HailScript.isActiveAndEnabled)
     {
         HailScript.PreCullCamera(camera);
     }
     if (SleetScript != null && SleetScript.isActiveAndEnabled)
     {
         SleetScript.PreCullCamera(camera);
     }
     if (CustomPrecipitationScript != null && CustomPrecipitationScript.isActiveAndEnabled)
     {
         CustomPrecipitationScript.PreCullCamera(camera);
     }
     if (SkySphereScript != null && SkySphereScript.isActiveAndEnabled)
     {
         SkySphereScript.PreCullCamera(camera);
     }
     if (CloudScript != null)
     {
         CloudScript.PreCullCamera(camera);
     }
     if (SkyPlaneScript != null && SkyPlaneScript.isActiveAndEnabled)
     {
         SkyPlaneScript.PreCullCamera(camera);
     }
     if (FogScript != null)
     {
         FogScript.PreCullCamera(camera);
     }
     if (LightManagerScript != null && LightManagerScript.isActiveAndEnabled)
     {
         LightManagerScript.PrepareToRenderCamera(camera);
     }
     if (CommandBufferManagerScript != null && CommandBufferManagerScript.isActiveAndEnabled)
     {
         CommandBufferManagerScript.PreCullCamera(camera);
     }
 }
示例#2
0
        private void CameraPreCull(Camera camera)
        {
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                return;
            }
#endif

            if (camera.depthTextureMode == DepthTextureMode.None)
            {
                camera.depthTextureMode = DepthTextureMode.Depth;
            }
            if (LightManagerScript != null && LightManagerScript.isActiveAndEnabled)
            {
                LightManagerScript.PreCullCamera(camera);
            }
            if (RainScript != null && RainScript.isActiveAndEnabled)
            {
                RainScript.PreCullCamera(camera);
            }
            if (SnowScript != null && SnowScript.isActiveAndEnabled)
            {
                SnowScript.PreCullCamera(camera);
            }
            if (HailScript != null && HailScript.isActiveAndEnabled)
            {
                HailScript.PreCullCamera(camera);
            }
            if (SleetScript != null && SleetScript.isActiveAndEnabled)
            {
                SleetScript.PreCullCamera(camera);
            }
            if (CustomPrecipitationScript != null && CustomPrecipitationScript.isActiveAndEnabled)
            {
                CustomPrecipitationScript.PreCullCamera(camera);
            }
            if (SkySphereScript != null && SkySphereScript.isActiveAndEnabled)
            {
                SkySphereScript.PreCullCamera(camera);
            }
            if (SkyPlaneScript != null && SkyPlaneScript.isActiveAndEnabled)
            {
                SkyPlaneScript.PreCullCamera(camera);
            }
            if (CloudScript != null && CloudScript.isActiveAndEnabled)
            {
                CloudScript.PreCullCamera(camera);
            }
            if (SnowOverlayScript != null && SnowOverlayScript.isActiveAndEnabled)
            {
                SnowOverlayScript.PreCullCamera(camera);
            }
            if (FogScript != null && FogScript.isActiveAndEnabled)
            {
                FogScript.PreCullCamera(camera);
            }
            if (LightManagerScript != null && LightManagerScript.isActiveAndEnabled)
            {
                LightManagerScript.PreCullCamera(camera);
            }
            if (CommandBufferManagerScript != null && CommandBufferManagerScript.isActiveAndEnabled)
            {
                CommandBufferManagerScript.PreCullCamera(camera);
            }
        }