File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,11 @@ virtual protected void ApplyClipping(UpdateContext context)
297297 int cnt = _renderers . Count ;
298298 for ( int i = 0 ; i < cnt ; i ++ )
299299 {
300- _renderers [ i ] . renderer . GetMaterials ( helperMaterials ) ;
300+ Renderer renderer = _renderers [ i ] . renderer ;
301+ if ( renderer == null )
302+ continue ;
303+
304+ renderer . GetMaterials ( helperMaterials ) ;
301305
302306 int cnt2 = helperMaterials . Count ;
303307 for ( int j = 0 ; j < cnt2 ; j ++ )
@@ -313,17 +317,16 @@ virtual protected void ApplyClipping(UpdateContext context)
313317 int cnt = _renderers . Count ;
314318 for ( int i = 0 ; i < cnt ; i ++ )
315319 {
316- RendererInfo ri = _renderers [ i ] ;
317- Material [ ] mats = ri . materials ;
318- if ( mats != null )
320+ Material [ ] mats = _renderers [ i ] . materials ;
321+ if ( mats == null )
322+ continue ;
323+
324+ int cnt2 = mats . Length ;
325+ for ( int j = 0 ; j < cnt2 ; j ++ )
319326 {
320- int cnt2 = mats . Length ;
321- for ( int j = 0 ; j < cnt2 ; j ++ )
322- {
323- Material mat = mats [ j ] ;
324- if ( mat != null )
325- context . ApplyClippingProperties ( mat , false ) ;
326- }
327+ Material mat = mats [ j ] ;
328+ if ( mat != null )
329+ context . ApplyClippingProperties ( mat , false ) ;
327330 }
328331 }
329332#endif
You can’t perform that action at this time.
0 commit comments