Make stars not do shader stuff if luminosity is 0

This commit is contained in:
Nick J. Connors 2022-02-24 21:00:29 -05:00
parent 7f1e52af55
commit 93a9d2c40f
2 changed files with 14 additions and 8 deletions

View File

@ -152,14 +152,18 @@ namespace NewHorizons.Builder.Body
starGO.transform.localPosition = Vector3.zero;
starGO.transform.localScale = starModule.Size * Vector3.one;
var starController = body.AddComponent<StarController>();
starController.Light = light;
starController.AmbientLight = ambientLight;
starController.FaceActiveCamera = faceActiveCamera;
starController.CSMTextureCacher = csmTextureCacher;
starController.ProxyShadowLight = proxyShadowLight;
starController.Intensity = starModule.SolarLuminosity;
starController.SunColor = lightColour;
StarController starController = null;
if (starModule.SolarLuminosity != 0)
{
starController = body.AddComponent<StarController>();
starController.Light = light;
starController.AmbientLight = ambientLight;
starController.FaceActiveCamera = faceActiveCamera;
starController.CSMTextureCacher = csmTextureCacher;
starController.ProxyShadowLight = proxyShadowLight;
starController.Intensity = starModule.SolarLuminosity;
starController.SunColor = lightColour;
}
if (starModule.Curve != null)
{

View File

@ -28,6 +28,8 @@ namespace NewHorizons.Utility
public void AddStar(StarController star)
{
if (star == null) return;
Logger.Log($"Adding new star to list: {star.gameObject.name}");
_stars.Add(star);
}