From e083c5aa836a557304241aabc88d1b02b70a0bf3 Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Fri, 19 Jun 2020 14:39:13 +0200 Subject: [PATCH 1/2] Fixed an issue where manipulating the color wheels in a volume component would reset the cursor every time. --- .../Editor/Volume/VolumeComponentListEditor.cs | 4 ++-- .../Runtime/Volume/VolumeProfile.cs | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs index 21a110079a0..9669c56a435 100644 --- a/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs +++ b/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs @@ -199,10 +199,10 @@ public void OnGUI() // Even if the asset is not dirty, the list of component may have been changed by another inspector. // In this case, only the hash will tell us that we need to refresh. - if (asset.isDirty || asset.GetHashCode() != m_CurrentHashCode) + if (asset.isDirty || asset.GetComponentListHashCode() != m_CurrentHashCode) { RefreshEditors(); - m_CurrentHashCode = asset.GetHashCode(); + m_CurrentHashCode = asset.GetComponentListHashCode(); asset.isDirty = false; } diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs index 198a44af7ac..a687a86fb4d 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.cs @@ -297,5 +297,18 @@ public override int GetHashCode() return hash; } } + + internal int GetComponentListHashCode() + { + unchecked + { + int hash = 17; + + for (int i = 0; i < components.Count; i++) + hash = hash * 23 + components[i].GetType().GetHashCode(); + + return hash; + } + } } } From 50a8d05f3bf1f63aff03142ee39a9eb218f0d61b Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Fri, 19 Jun 2020 14:39:27 +0200 Subject: [PATCH 2/2] Update changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 82e1442dfbf..ff927fa5788 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -692,6 +692,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed warning in HDAdditionalLightData OnValidate (cases 1250864, 1244578) - Fixed a bug related to denoising ray traced reflections. - Fixed nullref in the layered lit material inspector. +- Fixed an issue where manipulating the color wheels in a volume component would reset the cursor every time. ### Changed - Improve MIP selection for decals on Transparents