From fd3c5975eb23edcccaada915c894786692790dc8 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 23 Mar 2024 14:38:11 -0700 Subject: [PATCH] move cull fix above FixSectoredComponent or else it nres --- NewHorizons/Builder/Props/DetailBuilder.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 7e1bb581..6a05cb09 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -140,16 +140,16 @@ namespace NewHorizons.Builder.Props } else { - FixSectoredComponent(component, sector, existingSectors); - } + // Fix cull groups only when not from an asset bundle (because then they're there on purpose!) + // keepLoaded should remove existing groups + // renderers/colliders get enabled later so we dont have to do that here + if (detail.keepLoaded && !isFromAssetBundle && component is SectorCullGroup or SectorCollisionGroup or SectorLightsCullGroup) + { + UnityEngine.Object.DestroyImmediate(component); + continue; + } - // Fix cull groups only when not from an asset bundle (because then they're there on purpose!) - // keepLoaded should remove existing groups - // renderers/colliders get enabled later so we dont have to do that here - if (detail.keepLoaded && !isFromAssetBundle && component is SectorCullGroup or SectorCollisionGroup or SectorLightsCullGroup) - { - UnityEngine.Object.DestroyImmediate(component); - continue; + FixSectoredComponent(component, sector, existingSectors); } // Asset bundle is a real string -> Object loaded from unity