Set locator sun transform to the active sun

This commit is contained in:
Nick 2023-07-22 00:13:39 -04:00
parent 0d66d7fce5
commit 43c3392466
2 changed files with 7 additions and 1 deletions

View File

@ -192,6 +192,9 @@ namespace NewHorizons.Components.Stars
// For the param thing to work it wants this to be on the star idk // For the param thing to work it wants this to be on the star idk
transform.parent = star.transform; transform.parent = star.transform;
transform.localPosition = Vector3.zero; transform.localPosition = Vector3.zero;
// Some effects use Locator.GetSunTransform so hopefully its fine to change it
Locator._sunTransform = transform;
} }
} }
} }

View File

@ -644,7 +644,10 @@ namespace NewHorizons.Handlers
if (!string.IsNullOrEmpty(body.Config.Atmosphere?.clouds?.texturePath)) if (!string.IsNullOrEmpty(body.Config.Atmosphere?.clouds?.texturePath))
{ {
CloudsBuilder.Make(go, sector, body.Config.Atmosphere, willHaveCloak, body.Mod); CloudsBuilder.Make(go, sector, body.Config.Atmosphere, willHaveCloak, body.Mod);
if (body.Config.Atmosphere.clouds.cloudsPrefab != External.Modules.CloudPrefabType.Transparent) SunOverrideBuilder.Make(go, sector, body.Config.Atmosphere, body.Config.Water, surfaceSize); if (body.Config.Atmosphere.clouds.cloudsPrefab != External.Modules.CloudPrefabType.Transparent)
{
SunOverrideBuilder.Make(go, sector, body.Config.Atmosphere, body.Config.Water, surfaceSize);
}
} }
if (body.Config.Atmosphere.hasRain || body.Config.Atmosphere.hasSnow) if (body.Config.Atmosphere.hasRain || body.Config.Atmosphere.hasSnow)