@@ -162,7 +162,7 @@ private void ViewBatch(int index)
162
162
163
163
foreach ( var obj in batch1 . Lights )
164
164
{
165
- if ( obj != null )
165
+ if ( obj != null )
166
166
lightBubble1 . Add ( MakePill ( obj ) ) ;
167
167
}
168
168
@@ -241,7 +241,7 @@ private void CompareBatch(int index1, int index2)
241
241
lightBubble1 . Clear ( ) ;
242
242
foreach ( var obj in lightSet1 )
243
243
{
244
- if ( obj != null )
244
+ if ( obj != null )
245
245
lightBubble1 . Add ( MakePill ( obj ) ) ;
246
246
}
247
247
@@ -255,7 +255,7 @@ private void CompareBatch(int index1, int index2)
255
255
lightBubble2 . Clear ( ) ;
256
256
foreach ( var obj in lightSet2 )
257
257
{
258
- if ( obj != null )
258
+ if ( obj != null )
259
259
lightBubble2 . Add ( MakePill ( obj ) ) ;
260
260
}
261
261
@@ -391,7 +391,7 @@ private void OnSelectionChanged()
391
391
var firstIndex = batchListView . selectedIndices . First ( ) ;
392
392
var secondIndex = batchListView . selectedIndices . Last ( ) ;
393
393
394
- if ( secondIndex > firstIndex + 1 || secondIndex < firstIndex - 1 )
394
+ if ( secondIndex > firstIndex + 1 || secondIndex < firstIndex - 1 )
395
395
{
396
396
// Clamp since we do adjacent batch comparisons
397
397
secondIndex = Mathf . Clamp ( secondIndex , firstIndex - 1 , firstIndex + 1 ) ;
@@ -408,7 +408,7 @@ private void OnSelectionChanged()
408
408
409
409
default :
410
410
// Account for multiple select either with shift or ctrl keys
411
- if ( batchListView . selectedIndices . Count ( ) > 2 )
411
+ if ( batchListView . selectedIndices . Count ( ) > 2 )
412
412
{
413
413
if ( selectedIndices . Count == 1 )
414
414
{
@@ -466,8 +466,12 @@ private bool IsDirty()
466
466
isDirty |= Light2DManager . GetCachedSortingLayer ( ) . Count ( ) != batchList . Sum ( x => x . LayerNames . Count ( ) ) ;
467
467
isDirty |= cachedSceneHandle != SceneManager . GetActiveScene ( ) . handle ;
468
468
isDirty |= cachedCamPos != Camera . main ? . transform . position ;
469
- isDirty |= totalLightCount != lightCullResult . visibleLights . Count ( ) ;
470
- isDirty |= totalShadowCount != lightCullResult . visibleShadows . Count ( ) ;
469
+
470
+ if ( lightCullResult . IsGameView ( ) )
471
+ {
472
+ isDirty |= totalLightCount != lightCullResult . visibleLights . Count ( ) ;
473
+ isDirty |= totalShadowCount != lightCullResult . visibleShadows . Count ( ) ;
474
+ }
471
475
472
476
return isDirty ;
473
477
}
0 commit comments