示例#1
0
        void DrawQuickSetup()
        {
            SetWindowHeight(375f);

            EditorGUILayout.HelpBox("\nThese actions will automatically configure your scene for use with the Post Processing Stack.\n", MessageType.Info);

            EditorGUILayout.Space();

            //Camera setup
            EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
            {
                EditorGUILayout.LabelField("Setup component on active camera");
                if (GUILayout.Button("Execute"))
                {
                    AutoSetup.SetupCamera();
                }
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Space();

            //Volume setup
            EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
            {
                EditorGUILayout.LabelField("Create a new global Post Processing volume");
                if (GUILayout.Button("Execute"))
                {
                    AutoSetup.SetupGlobalVolume();
                }
            }
            EditorGUILayout.EndHorizontal();
        }
示例#2
0
        public static void DisplaySetupWarning <T>(bool state = true)
#endif
        {
#if URP && !PPS
            ScriptableRendererData[] rendererDataList = (ScriptableRendererData[])typeof(UniversalRenderPipelineAsset).GetField("m_RendererDataList", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(UniversalRenderPipeline.asset);
            int defaultRendererIndex = (int)typeof(UniversalRenderPipelineAsset).GetField("m_DefaultRendererIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(UniversalRenderPipeline.asset);
            ScriptableRendererData forwardRenderer = rendererDataList[defaultRendererIndex];

            if (forwardRenderer.GetType() == typeof(Renderer2DData))
            {
                EditorGUILayout.HelpBox("2D renderer is not supported", MessageType.Error);
            }

            if (state)
            {
                return;
            }

            EditorGUILayout.HelpBox("Effect has not been added to the default renderer's\n\"Renderer Features\" list. Will not render otherwise.", MessageType.Warning);

            GUILayout.Space(-32);
            using (new EditorGUILayout.HorizontalScope())
            {
                GUILayout.FlexibleSpace();
                if (GUILayout.Button(new GUIContent("Add", EditorGUIUtility.IconContent("d_tab_next").image), GUILayout.Width(60)))
                {
                    AutoSetup.SetupEffect <T>();
                    state = true;
                }
                GUILayout.Space(8);
            }
            GUILayout.Space(11);
#endif
//Post processing feature set was removed in 2020.1, compile out in case the user imports the asset with URP+PPS in 2020.1
#if URP && PPS && !UNITY_2020_1_OR_NEWER
            if (UniversalRenderPipeline.asset && UniversalRenderPipeline.asset.postProcessingFeatureSet == PostProcessingFeatureSet.Integrated)
            {
                EditorGUILayout.HelpBox("Post Processing Stack v2 installed, but URP isn't configured to use it", MessageType.Error);

                GUILayout.Space(-32);
                using (new EditorGUILayout.HorizontalScope())
                {
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button(new GUIContent("Fix", EditorGUIUtility.IconContent("d_tab_next").image), GUILayout.Width(60)))
                    {
                        UniversalRenderPipeline.asset.postProcessingFeatureSet = PostProcessingFeatureSet.PostProcessingV2;
                    }
                    GUILayout.Space(8);
                }
                GUILayout.Space(11);
            }
#endif
#if URP && PPS && UNITY_2020_1_OR_NEWER
            EditorGUILayout.HelpBox("Post Processing package and URP no longer work together since Unity 2020.1+.\n\nUninstall the Post-processing package and re-run the SC Post Effects installer. See documentation", MessageType.Error);
#endif
#if !URP && PPS
            //Nothing
#endif
        }
示例#3
0
 public static void PostInstall()
 {
     if (Settings.deleteDemoContent)
     {
         AssetDatabase.DeleteAsset(Demo.SCENES_PACKAGE_PATH);
     }
     if (Settings.setupCurrentScene)
     {
         AutoSetup.SetupCamera();
         AutoSetup.SetupGlobalVolume();
     }
 }
示例#4
0
文件: GUI.cs 项目: ailoving00/_Wendy
        public static void DisplaySetupWarning()
#endif
        {
#if URP && PPS
            if (UniversalRenderPipeline.asset && UniversalRenderPipeline.asset.postProcessingFeatureSet == PostProcessingFeatureSet.Integrated)
            {
                EditorGUILayout.HelpBox("Post Processing Stack v2 installed, but URP isn't configured to use it", MessageType.Error);

                GUILayout.Space(-32);
                using (new EditorGUILayout.HorizontalScope())
                {
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button(new GUIContent("Fix", EditorGUIUtility.IconContent("d_tab_next").image), GUILayout.Width(60)))
                    {
                        UniversalRenderPipeline.asset.postProcessingFeatureSet = PostProcessingFeatureSet.PostProcessingV2;
                    }
                    GUILayout.Space(8);
                }
                GUILayout.Space(11);
            }
#endif

#if URP && !PPS
            if (state)
            {
                return;
            }

            EditorGUILayout.HelpBox("Effect has not been added to the Forward renderer's\n\"Renderer Features\" list. Will not render otherwise.", MessageType.Warning);

            GUILayout.Space(-32);
            using (new EditorGUILayout.HorizontalScope())
            {
                GUILayout.FlexibleSpace();
                if (GUILayout.Button(new GUIContent("Add", EditorGUIUtility.IconContent("d_tab_next").image), GUILayout.Width(60)))
                {
                    AutoSetup.SetupEffect <T>();
                    state = true;
                }
                GUILayout.Space(8);
            }
            GUILayout.Space(11);
#endif
        }