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.localPosition = Vector3.zero;
starGO.transform.localScale = starModule.Size * Vector3.one; starGO.transform.localScale = starModule.Size * Vector3.one;
var starController = body.AddComponent<StarController>(); StarController starController = null;
starController.Light = light; if (starModule.SolarLuminosity != 0)
starController.AmbientLight = ambientLight; {
starController.FaceActiveCamera = faceActiveCamera; starController = body.AddComponent<StarController>();
starController.CSMTextureCacher = csmTextureCacher; starController.Light = light;
starController.ProxyShadowLight = proxyShadowLight; starController.AmbientLight = ambientLight;
starController.Intensity = starModule.SolarLuminosity; starController.FaceActiveCamera = faceActiveCamera;
starController.SunColor = lightColour; starController.CSMTextureCacher = csmTextureCacher;
starController.ProxyShadowLight = proxyShadowLight;
starController.Intensity = starModule.SolarLuminosity;
starController.SunColor = lightColour;
}
if (starModule.Curve != null) if (starModule.Curve != null)
{ {

View File

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