Creation handler

This commit is contained in:
TerrificTrifid 2023-02-23 23:30:53 -06:00
parent 5b9809f041
commit 6442f6bb22
2 changed files with 4 additions and 3 deletions

View File

@ -5,7 +5,7 @@ namespace NewHorizons.Builder.General
{
public static class AmbientLightBuilder
{
public static Light Make(GameObject planetGO, Sector sector, AmbientLightModule config)
public static Light Make(GameObject planetGO, Sector sector, AmbientLightModule config, float surfaceSize)
{
var ambientLight = Main.Instance.CurrentStarSystem == "EyeOfTheUniverse" ? SearchUtilities.Find("EyeOfTheUniverse_Body/Sector_EyeOfTheUniverse/SixthPlanet_Root/QuantumMoonProxy_Pivot/QuantumMoonProxy_Root/MoonState_Root/AmbientLight_QM") : SearchUtilities.Find("QuantumMoon_Body/AmbientLight_QM");
if (ambientLight == null) return null;

View File

@ -498,9 +498,10 @@ namespace NewHorizons.Handlers
var sphereOfInfluence = GetSphereOfInfluence(body);
Light[] ambientLight = null;
if (body.Config.Base.ambientLight != 0)
if (body.Config.AmbientLights != null)
{
ambientLight = AmbientLightBuilder.Make(go, sector, sphereOfInfluence, body.Config.Base.ambientLight);
ambientLight = new Light[0];
foreach (var light in body.Config.AmbientLights) ambientLight.Append(AmbientLightBuilder.Make(go, sector, light, body.Config.Base.surfaceSize)).ToArray();
}
if (body.Config.Base.groundSize != 0)