mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Turn off if planet is off
This commit is contained in:
parent
199d806194
commit
f993a0870c
@ -39,6 +39,7 @@ namespace NewHorizons.Builder.Body
|
||||
{
|
||||
proxyController = proxy.AddComponent<NHProxy>();
|
||||
proxyController.astroName = body.Config.name;
|
||||
proxyController._planet = planetGO;
|
||||
}
|
||||
|
||||
var success = SharedMake(planetGO, proxy, proxyController, body);
|
||||
|
||||
@ -9,6 +9,7 @@ namespace NewHorizons.Components
|
||||
{
|
||||
public string astroName;
|
||||
|
||||
public GameObject _planet;
|
||||
public GameObject _star;
|
||||
private Renderer[] _starRenderers;
|
||||
private TessellatedRenderer[] _starTessellatedRenderers;
|
||||
@ -79,6 +80,14 @@ namespace NewHorizons.Components
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
if (_planet == null || !_planet.activeSelf)
|
||||
{
|
||||
_outOfRange = false;
|
||||
ToggleRendering(false);
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_stellarRemnant != null)
|
||||
{
|
||||
if (_stellarRemnant.IsActiveAndEnabled())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user