public static void EnableStandardPipeline()
 {
     UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset = null;
     WeatherMakerEditorUtility.ReplaceGrabPassInAllShaders(true);
     WeatherMakerEditorUtility.UpdatePreProcessor(false, "UNITY_URP");
     WeatherMakerEditorUtility.UpdatePreProcessor(false, "UNITY_HDRP");
     AssetDatabase.Refresh();
     UnityEditor.EditorUtility.DisplayDialog("Success", "Standard pipeline enabled", "OK");
 }
示例#2
0
 public static void EnableStandardPipeline()
 {
     UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset = null;
     string[] guids = AssetDatabase.FindAssets("WeatherMakerPrefab");
     if (guids.Length != 0)
     {
         string path = Path.GetDirectoryName(AssetDatabase.GUIDToAssetPath(guids[0]));
         path = Path.Combine(path, "ScriptableRenderPipeline");
         UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset = null;
         FileUtil.DeleteFileOrDirectory(path);
     }
     WeatherMakerEditorUtility.ReplaceGrabPassInAllShaders(true);
     WeatherMakerEditorUtility.UpdatePreProcessor(false, "UNITY_LWRP");
     //WeatherMakerEditorUtility.UpdatePreProcessor(false, "UNITY_HDRP");
     AssetDatabase.Refresh();
     UnityEditor.EditorUtility.DisplayDialog("Success", "Standard pipeline enabled", "OK");
 }
示例#3
0
        public static void EnableLightweightPipeline()
        {
            if (!WeatherMakerEditorUtility.TypeExists("UnityEngine.Rendering.LWRP.LightweightRenderPipeline"))
            {
                UnityEditor.EditorUtility.DisplayDialog("Error", "Please import LWRP package first, latest 5.X version supported.", "OK");
                return;
            }
            string[] packageGuids = AssetDatabase.FindAssets("WeatherMakerLWRPPackage");
            if (packageGuids.Length != 1)
            {
                UnityEditor.EditorUtility.DisplayDialog("Error", "Missing WeatherMakerLWRPPackage.unitypackage file, please re-download from asset store", "OK");
                return;
            }

            WeatherMakerEditorUtility.ReplaceGrabPassInAllShaders(false);
            WeatherMakerEditorUtility.UpdatePreProcessor(true, "UNITY_LWRP");
            AssetDatabase.ImportPackage(AssetDatabase.GUIDToAssetPath(packageGuids[0]), true);
        }
        private static void EnableURPInternal(string type, string profile, string importErrorText, string profileErrorText, string renderFeatureText)
        {
            if (!WeatherMakerEditorUtility.TypeExists(type))
            {
                UnityEditor.EditorUtility.DisplayDialog("Error", importErrorText, "OK");
                return;
            }

            string[] guids = AssetDatabase.FindAssets(profile);
            if (guids.Length == 0)
            {
                UnityEditor.EditorUtility.DisplayDialog("Error", profileErrorText, "OK");
                return;
            }

            WeatherMakerEditorUtility.ReplaceGrabPassInAllShaders(false);
            WeatherMakerEditorUtility.UpdatePreProcessor(true, "UNITY_URP");
            string assetPath             = AssetDatabase.GUIDToAssetPath(guids[0]);
            RenderPipelineAsset pipeline = AssetDatabase.LoadAssetAtPath <RenderPipelineAsset>(assetPath);

            UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset = pipeline;
            UnityEditor.EditorUtility.DisplayDialog("Notice", renderFeatureText, "OK");
        }