From 577ebe50e906173f9f6604a4938a39c8f8de7163 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Tue, 24 Nov 2020 19:47:56 +0100 Subject: [PATCH] Revert "Fixed an issue where a warning about the static sky not being ready was wrongly displayed. (#2727)" This reverts commit 4b1e36eb708101a60cb682b98925984dcd40a711. --- .../CHANGELOG.md | 1 - .../Runtime/Sky/SkyManager.cs | 23 +++++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 081414e334f..52d7ded6f1d 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -25,7 +25,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed normal buffer not bound to custom pass anymore. - Fixed issues with camera management in the graphics compositor (cases 1292548, 1292549). - Fixes some labels being clipped in the Render Graph Viewer -- Fixed an issue where a warning about the static sky not being ready was wrongly displayed. ### Changed - Removed the material pass probe volumes evaluation mode. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs index a658cf5cd8d..37872c85a65 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs @@ -153,12 +153,20 @@ class SkyManager // 2 by default: Static sky + one dynamic. Will grow if needed. DynamicArray m_CachedSkyContexts = new DynamicArray(2); - - public SkyManager() - {} - ~SkyManager() - {} + public SkyManager() + { +#if UNITY_EDITOR + UnityEditor.Lightmapping.bakeStarted += OnBakeStarted; + #endif + } + + ~SkyManager() + { +#if UNITY_EDITOR + UnityEditor.Lightmapping.bakeStarted -= OnBakeStarted; +#endif + } internal static SkySettings GetSkySetting(VolumeStack stack) { @@ -285,10 +293,6 @@ public void Build(HDRenderPipelineAsset hdAsset, RenderPipelineResources default } InitializeBlackCubemapArray(); - -#if UNITY_EDITOR - UnityEditor.Lightmapping.bakeStarted += OnBakeStarted; -#endif } void InitializeBlackCubemapArray() @@ -334,7 +338,6 @@ public void Cleanup() #if UNITY_EDITOR CoreUtils.Destroy(m_DefaultPreviewSky); - UnityEditor.Lightmapping.bakeStarted -= OnBakeStarted; #endif }