Skip to content

Commit 852dcdf

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [2022.3] [UUM-101919][6000.3][2D] Fix Light Batching Debugger UI constantly refreshing
1 parent 375c994 commit 852dcdf

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -457,18 +457,17 @@ private void Update()
457457

458458
private bool IsDirty()
459459
{
460+
if (lightCullResult == null)
461+
return false;
462+
460463
bool isDirty = false;
461464

462465
// Refresh if layers are added or removed
463466
isDirty |= Light2DManager.GetCachedSortingLayer().Count() != batchList.Sum(x => x.LayerNames.Count());
464467
isDirty |= cachedSceneHandle != SceneManager.GetActiveScene().handle;
465468
isDirty |= cachedCamPos != Camera.main?.transform.position;
466-
467-
if (lightCullResult != null)
468-
{
469-
isDirty |= totalLightCount != lightCullResult.visibleLights.Count();
470-
isDirty |= totalShadowCount != lightCullResult.visibleShadows.Count();
471-
}
469+
isDirty |= totalLightCount != lightCullResult.visibleLights.Count();
470+
isDirty |= totalShadowCount != lightCullResult.visibleShadows.Count();
472471

473472
return isDirty;
474473
}

0 commit comments

Comments
 (0)