Star Light Radius

This commit is contained in:
Noah Pilarski 2022-05-30 03:33:57 -04:00
parent 63cf135550
commit 937e389719
3 changed files with 15 additions and 1 deletions

View File

@ -87,6 +87,7 @@ namespace NewHorizons.Builder.Body
var light = sunLight.AddComponent<Light>();
light.CopyPropertiesFrom(SearchUtilities.Find("Sun_Body/Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>());
light.intensity *= starModule.solarLuminosity;
light.range = starModule.lightRadius;
light.range *= Mathf.Sqrt(starModule.solarLuminosity);
Color lightColour = light.color;

View File

@ -1,4 +1,4 @@
using System.ComponentModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using NewHorizons.Utility;
using Newtonsoft.Json;
@ -55,5 +55,11 @@ namespace NewHorizons.External.Modules.VariableSize
/// Colour of the star.
/// </summary>
public MColor tint;
/// <summary>
/// How far the light from the star can reach.
/// </summary>
[DefaultValue(50000f)] [Range(0f, double.MaxValue)]
public float lightRadius = 50000f;
}
}

View File

@ -1772,6 +1772,13 @@
"tint": {
"description": "Colour of the star.",
"$ref": "#/definitions/MColor"
},
"lightRadius": {
"type": "number",
"description": "How far the light from the star can reach.",
"format": "float",
"default": 50000.0,
"minimum": 0.0
}
}
},