mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Customizable Ambient Light Intensity
https://github.com/xen-42/outer-wilds-new-horizons/issues/130
This commit is contained in:
parent
07ce1a45b3
commit
f6c601a208
@ -3,7 +3,7 @@ namespace NewHorizons.Builder.General
|
|||||||
{
|
{
|
||||||
public static class AmbientLightBuilder
|
public static class AmbientLightBuilder
|
||||||
{
|
{
|
||||||
public static void Make(GameObject planetGO, Sector sector, float scale)
|
public static void Make(GameObject planetGO, Sector sector, float scale, float intensity = 0.5f)
|
||||||
{
|
{
|
||||||
GameObject lightGO = GameObject.Instantiate(GameObject.Find("BrittleHollow_Body/AmbientLight_BH_Surface"), sector?.transform ?? planetGO.transform);
|
GameObject lightGO = GameObject.Instantiate(GameObject.Find("BrittleHollow_Body/AmbientLight_BH_Surface"), sector?.transform ?? planetGO.transform);
|
||||||
lightGO.transform.position = planetGO.transform.position;
|
lightGO.transform.position = planetGO.transform.position;
|
||||||
@ -19,7 +19,7 @@ namespace NewHorizons.Builder.General
|
|||||||
|
|
||||||
light.color = new Color(0.0f, 0.0f, 0.8f, 0.0225f);
|
light.color = new Color(0.0f, 0.0f, 0.8f, 0.0225f);
|
||||||
light.range = scale;
|
light.range = scale;
|
||||||
light.intensity = 0.5f;
|
light.intensity = intensity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
NewHorizons/External/Modules/BaseModule.cs
vendored
2
NewHorizons/External/Modules/BaseModule.cs
vendored
@ -4,7 +4,9 @@ namespace NewHorizons.External.Modules
|
|||||||
public class BaseModule
|
public class BaseModule
|
||||||
{
|
{
|
||||||
public bool HasMapMarker { get; set; }
|
public bool HasMapMarker { get; set; }
|
||||||
|
[System.Obsolete("HasAmbientLight is deprecated, please use AmbientLight instead")]
|
||||||
public bool HasAmbientLight { get; set; }
|
public bool HasAmbientLight { get; set; }
|
||||||
|
public float AmbientLight { get; set; }
|
||||||
public float SurfaceGravity { get; set; }
|
public float SurfaceGravity { get; set; }
|
||||||
public string GravityFallOff { get; set; } = "linear";
|
public string GravityFallOff { get; set; } = "linear";
|
||||||
public float SurfaceSize { get; set; }
|
public float SurfaceSize { get; set; }
|
||||||
|
|||||||
@ -378,7 +378,11 @@ namespace NewHorizons.Handlers
|
|||||||
{
|
{
|
||||||
var sphereOfInfluence = GetSphereOfInfluence(body);
|
var sphereOfInfluence = GetSphereOfInfluence(body);
|
||||||
|
|
||||||
if (body.Config.Base.HasAmbientLight)
|
if (body.Config.Base.AmbientLight != 0)
|
||||||
|
{
|
||||||
|
AmbientLightBuilder.Make(go, sector, sphereOfInfluence, body.Config.Base.AmbientLight);
|
||||||
|
}
|
||||||
|
else if (body.Config.Base.HasAmbientLight)
|
||||||
{
|
{
|
||||||
AmbientLightBuilder.Make(go, sector, sphereOfInfluence);
|
AmbientLightBuilder.Make(go, sector, sphereOfInfluence);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -209,10 +209,10 @@
|
|||||||
"default": false,
|
"default": false,
|
||||||
"description": "If the body should have a marker on the map screen."
|
"description": "If the body should have a marker on the map screen."
|
||||||
},
|
},
|
||||||
"hasAmbientLight": {
|
"ambientLight": {
|
||||||
"type": "boolean",
|
"type": "number",
|
||||||
"default": false,
|
"default": 0,
|
||||||
"description": "If the dark side of the body should have some slight amount of light"
|
"description": "The intensity of light the dark side of the body should have. Timber Hearth has 1.4 for reference"
|
||||||
},
|
},
|
||||||
"surfaceGravity": {
|
"surfaceGravity": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user