mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'dev' of https://github.com/xen-42/outer-wilds-new-horizons into dev
This commit is contained in:
commit
115eade952
@ -18,6 +18,8 @@ namespace NewHorizons.Builder.Body
|
||||
private static readonly int SkyColor = Shader.PropertyToID("_SkyColor");
|
||||
private static readonly int AtmosFar = Shader.PropertyToID("_AtmosFar");
|
||||
private static readonly int AtmosNear = Shader.PropertyToID("_AtmosNear");
|
||||
private static readonly int Tint = Shader.PropertyToID("_Tint");
|
||||
private static readonly int Radius = Shader.PropertyToID("_Radius");
|
||||
private static readonly int InnerRadius = Shader.PropertyToID("_InnerRadius");
|
||||
private static readonly int OuterRadius = Shader.PropertyToID("_OuterRadius");
|
||||
|
||||
@ -47,6 +49,7 @@ namespace NewHorizons.Builder.Body
|
||||
if (starModule.tint != null)
|
||||
{
|
||||
fog.fogTint = starModule.tint.ToColor();
|
||||
fog.fogImpostor.material.SetColor(Tint, starModule.tint.ToColor());
|
||||
sunAtmosphere.transform.Find("AtmoSphere").transform.localScale = Vector3.one;
|
||||
foreach (var lod in sunAtmosphere.transform.Find("AtmoSphere").GetComponentsInChildren<MeshRenderer>())
|
||||
{
|
||||
@ -60,6 +63,7 @@ namespace NewHorizons.Builder.Body
|
||||
fog.transform.localScale = Vector3.one;
|
||||
fog.fogRadius = starModule.size * OuterRadiusRatio;
|
||||
fog.lodFadeDistance = fog.fogRadius * (StarBuilder.OuterRadiusRatio - 1f);
|
||||
fog.fogImpostor.material.SetFloat(Radius, starModule.size * OuterRadiusRatio);
|
||||
}
|
||||
|
||||
var ambientLightGO = Object.Instantiate(SearchUtilities.Find("Sun_Body/AmbientLight_SUN"), starGO.transform);
|
||||
@ -137,9 +141,9 @@ namespace NewHorizons.Builder.Body
|
||||
controller.size = starModule.size;
|
||||
controller.atmosphere = sunAtmosphere;
|
||||
controller.supernova = supernova;
|
||||
controller.startColour = starModule.tint?.ToColor();
|
||||
controller.endColour = starModule.tint != null ? starModule.tint.ToColor() * 4.5948f : null;
|
||||
controller.willExplode = starModule.goSupernova;
|
||||
controller.StartColour = starModule.tint;
|
||||
controller.EndColour = starModule.endTint;
|
||||
controller.WillExplode = starModule.goSupernova;
|
||||
if (!string.IsNullOrEmpty(starModule.starRampTexture))
|
||||
{
|
||||
var ramp = ImageUtilities.GetTexture(mod, starModule.starRampTexture);
|
||||
@ -187,8 +191,8 @@ namespace NewHorizons.Builder.Body
|
||||
if (starModule.curve != null) controller.SetScaleCurve(starModule.curve);
|
||||
controller.size = starModule.size;
|
||||
controller.supernova = supernova;
|
||||
controller.startColour = starModule.tint?.ToColor();
|
||||
controller.endColour = starModule.tint != null ? starModule.tint.ToColor() * 4.5948f : null;
|
||||
controller.StartColour = starModule.tint;
|
||||
controller.EndColour = starModule.endTint;
|
||||
controller.enabled = true;
|
||||
starGO.SetActive(true);
|
||||
|
||||
|
||||
@ -15,9 +15,9 @@ namespace NewHorizons.Components.SizeControllers
|
||||
{
|
||||
public GameObject atmosphere;
|
||||
public SupernovaEffectController supernova;
|
||||
public bool willExplode;
|
||||
public Color? startColour;
|
||||
public Color? endColour;
|
||||
public bool WillExplode { get; set; }
|
||||
public MColor StartColour { get; set; }
|
||||
public MColor EndColour { get; set; }
|
||||
public Texture normalRamp;
|
||||
public Texture collapseRamp;
|
||||
|
||||
@ -84,25 +84,25 @@ namespace NewHorizons.Components.SizeControllers
|
||||
_startSurfaceMaterial.SetTexture(ColorRamp, _normalRamp);
|
||||
_endSurfaceMaterial.SetTexture(ColorRamp, _normalRamp);
|
||||
|
||||
if (startColour == null)
|
||||
if (StartColour == null)
|
||||
{
|
||||
_startColour = _startSurfaceMaterial.color;
|
||||
}
|
||||
else
|
||||
{
|
||||
_startColour = startColour.Value;
|
||||
_startColour = StartColour.ToColor();
|
||||
_startSurfaceMaterial.color = _startColour;
|
||||
}
|
||||
|
||||
if (endColour == null)
|
||||
if (EndColour == null)
|
||||
{
|
||||
_endColour = _startColour;
|
||||
_endSurfaceMaterial.color = _startColour;
|
||||
}
|
||||
else
|
||||
{
|
||||
_endColour = endColour.Value;
|
||||
_endSurfaceMaterial.color = _endColour;
|
||||
_endColour = EndColour.ToColor();
|
||||
_endSurfaceMaterial.color = _startColour * 4.5948f;
|
||||
}
|
||||
|
||||
_heatVolume = GetComponentInChildren<HeatHazardVolume>();
|
||||
@ -114,7 +114,7 @@ namespace NewHorizons.Components.SizeControllers
|
||||
_atmosphereRenderers = atmosphere?.transform?.Find("AtmoSphere")?.GetComponentsInChildren<MeshRenderer>();
|
||||
}
|
||||
|
||||
if (willExplode) GlobalMessenger.AddListener("TriggerSupernova", Die);
|
||||
if (WillExplode) GlobalMessenger.AddListener("TriggerSupernova", Die);
|
||||
|
||||
if (scaleCurve != null)
|
||||
{
|
||||
@ -132,7 +132,7 @@ namespace NewHorizons.Components.SizeControllers
|
||||
|
||||
public void OnDestroy()
|
||||
{
|
||||
if (willExplode) GlobalMessenger.RemoveListener("TriggerSupernova", Die);
|
||||
if (WillExplode) GlobalMessenger.RemoveListener("TriggerSupernova", Die);
|
||||
}
|
||||
|
||||
public void SetProxy(StarEvolutionController proxy)
|
||||
@ -183,7 +183,7 @@ namespace NewHorizons.Components.SizeControllers
|
||||
base.FixedUpdate();
|
||||
|
||||
// Only do colour transition stuff if they set an end colour
|
||||
if (endColour != null)
|
||||
if (EndColour != null)
|
||||
{
|
||||
// Use the age if theres no resizing happening, else make it get redder the larger it is or wtv
|
||||
var t = ageValue;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user