From dceed92013064a9d82b4537a09dfcfb9ccefd6b0 Mon Sep 17 00:00:00 2001 From: RSlysz Date: Wed, 17 Mar 2021 18:23:54 +0100 Subject: [PATCH] Fixed issue in wizard when resource folder not exist --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Editor/Wizard/HDWizard.Configuration.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index af9ed9c5bc9..0780bd13d92 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -110,6 +110,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed warning fixed on ShadowLoop include (HDRISky and Unlit+ShadowMatte) - Fixed SSR Precision for 4K Screens - Fixed issue with gbuffer debug view when virtual texturing is enabled. +- Fixed issue in wizard when resource folder don't exist ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard diff --git a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs index 016d989bc4d..c3d7ad50076 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs @@ -465,6 +465,9 @@ void FixHdrpAssetDiffusionProfile(bool fromAsyncUnused) var defaultAssetList = hdrpAsset.renderPipelineEditorResources.defaultDiffusionProfileSettingsList; hdrpAsset.diffusionProfileSettingsList = new DiffusionProfileSettings[0]; // clear the diffusion profile list + if (!AssetDatabase.IsValidFolder("Assets/" + HDProjectSettings.projectSettingsFolderPath)) + AssetDatabase.CreateFolder("Assets", HDProjectSettings.projectSettingsFolderPath); + foreach (var diffusionProfileAsset in defaultAssetList) { string defaultDiffusionProfileSettingsPath = "Assets/" + HDProjectSettings.projectSettingsFolderPath + "/" + diffusionProfileAsset.name + ".asset"; @@ -500,6 +503,9 @@ void FixDefaultVolumeProfileAssigned(bool fromAsyncUnused) VolumeProfile defaultSettingsVolumeProfileInPackage = hdrpAsset.renderPipelineEditorResources.defaultSettingsVolumeProfile; string defaultSettingsVolumeProfilePath = "Assets/" + HDProjectSettings.projectSettingsFolderPath + '/' + defaultSettingsVolumeProfileInPackage.name + ".asset"; + if (!AssetDatabase.IsValidFolder("Assets/" + HDProjectSettings.projectSettingsFolderPath)) + AssetDatabase.CreateFolder("Assets", HDProjectSettings.projectSettingsFolderPath); + //try load one if one already exist VolumeProfile defaultSettingsVolumeProfile = AssetDatabase.LoadAssetAtPath(defaultSettingsVolumeProfilePath); if (defaultSettingsVolumeProfile == null || defaultSettingsVolumeProfile.Equals(null))