public static void InstallShaders(ShaderInstallation config) { string guid = UniversalShaderPackageGUID; string packagePath = AssetDatabase.GUIDToAssetPath(guid); GetRootFolder(); //TODO: Package up current shaders if (config == ShaderInstallation.BuiltIn) { //AssetDatabase.ExportPackage(PACKAGE_ROOT_FOLDER + "/Shaders/URP", packagePath, ExportPackageOptions.Default | ExportPackageOptions.Recurse); UpgradeMaterials(config); } else { if (packagePath == string.Empty) { Debug.LogError("URP Shader/material package with the GUID: " + guid + ". Could not be found in the project, was it changed or not imported? It should be located in <i>" + PACKAGE_ROOT_FOLDER + "/Shaders/URP</i>"); return; } AssetDatabase.ImportPackage(packagePath, false); AssetDatabase.importPackageCompleted += new AssetDatabase.ImportPackageCallback(ImportURPCallback); } #if UNITY_2019_3_OR_NEWER && FAE_DEV SwitchRenderPipeline.SetPipeline(config); #endif }
public static void InstallURP() { #if UNITY_2019_3_OR_NEWER && FAE_DEV SwitchRenderPipeline.SetPipeline(ShaderInstallation.UniversalRP); #endif if (UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset == null) { if (EditorUtility.DisplayDialog("Fantasy Adventure Environment", "No URP asset has been assigned in the Graphics settings. URP should be set up, before converting the package.", "Show me", "Cancel")) { SettingsService.OpenProjectSettings("Project/Graphics"); return; } } InstallShaders(ShaderInstallation.UniversalRP); }