Fix atmospherebuilder cull group (affected hazydreams)

This commit is contained in:
xen-42 2025-03-17 11:49:11 -04:00
parent 0633470297
commit dd7bcbd5b1

View File

@ -100,6 +100,15 @@ namespace NewHorizons.Builder.Atmosphere
atmoGO.transform.position = planetGO.transform.TransformPoint(Vector3.zero);
atmoGO.SetActive(true);
// CullGroups have already set up their renderers when this is done so we need to add ourself to it
// TODO: There are probably other builders where this is relevant
// This in particular was a bug affecting hazy dreams
if (sector != null && sector.gameObject.GetComponent<CullGroup>() is CullGroup cullGroup)
{
cullGroup.RecursivelyAddRenderers(atmoGO.transform, true);
cullGroup.SetVisible(cullGroup.IsVisible());
}
return atmoGO;
}
}