예제 #1
0
        /// <summary>
        /// Updates the pipeline asset depth/opaque settings
        /// </summary>
        /// <param name="updateDepth"></param>
        /// <param name="updateOpaque"></param>
        public static void UpdateURPPipelineSettings(bool updateDepth, bool updateOpaque)
        {
            #if UPPipeline
            UniversalRenderPipelineAsset pipelineAsset = GraphicsSettings.renderPipelineAsset as UniversalRenderPipelineAsset;
            if (pipelineAsset != null)
            {
                if (updateDepth)
                {
                    pipelineAsset.supportsCameraDepthTexture = false;
                    pipelineAsset.supportsCameraDepthTexture = true;
                }

                if (updateOpaque)
                {
                    pipelineAsset.supportsCameraOpaqueTexture = false;
                    pipelineAsset.supportsCameraOpaqueTexture = true;
                }

                QualitySettings.renderPipeline = pipelineAsset;
                pipelineAsset.OnAfterDeserialize();
                EditorUtility.SetDirty(pipelineAsset);
                AssetDatabase.SaveAssets();
            }
            #endif
        }