mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix map mode sunlight and water sunlight
This commit is contained in:
parent
b325f87f5f
commit
4d5404bc6d
@ -47,10 +47,13 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
GameObject waterGO = new GameObject("Water");
|
||||
waterGO.SetActive(false);
|
||||
waterGO.layer = 15;
|
||||
waterGO.transform.parent = sector?.transform ?? planetGO.transform;
|
||||
waterGO.transform.localScale = new Vector3(waterSize, waterSize, waterSize);
|
||||
|
||||
// Don't ignore sun when not under clouds
|
||||
waterGO.layer = 0;
|
||||
Delay.FireOnNextUpdate(() => { if (planetGO.FindChild("Sector/SunOverride") != null) waterGO.layer = 15; });
|
||||
|
||||
TessellatedSphereRenderer TSR = waterGO.AddComponent<TessellatedSphereRenderer>();
|
||||
TSR.tessellationMeshGroup = ScriptableObject.CreateInstance<MeshGroup>();
|
||||
for (int i = 0; i < 16; i++)
|
||||
|
||||
@ -89,10 +89,12 @@ namespace NewHorizons.Components.Stars
|
||||
{
|
||||
origin = Locator.GetActiveCamera().transform.position;
|
||||
|
||||
// Keep all star lights on in map
|
||||
foreach (var light in _lights)
|
||||
{
|
||||
// Keep all star lights on in map
|
||||
light.enabled = true;
|
||||
// Fixes everything transparent breaking due to directional
|
||||
if (light.type == LightType.Directional) light.type = LightType.Point;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -110,6 +112,8 @@ namespace NewHorizons.Components.Stars
|
||||
{
|
||||
light.enabled = false;
|
||||
}
|
||||
// Revert map fix
|
||||
if (light.type == LightType.Point) light.type = LightType.Directional;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user