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 = proxy.AddComponent<NHProxy>();
|
||||||
proxyController.astroName = body.Config.name;
|
proxyController.astroName = body.Config.name;
|
||||||
|
proxyController._planet = planetGO;
|
||||||
}
|
}
|
||||||
|
|
||||||
var success = SharedMake(planetGO, proxy, proxyController, body);
|
var success = SharedMake(planetGO, proxy, proxyController, body);
|
||||||
|
|||||||
@ -9,6 +9,7 @@ namespace NewHorizons.Components
|
|||||||
{
|
{
|
||||||
public string astroName;
|
public string astroName;
|
||||||
|
|
||||||
|
public GameObject _planet;
|
||||||
public GameObject _star;
|
public GameObject _star;
|
||||||
private Renderer[] _starRenderers;
|
private Renderer[] _starRenderers;
|
||||||
private TessellatedRenderer[] _starTessellatedRenderers;
|
private TessellatedRenderer[] _starTessellatedRenderers;
|
||||||
@ -79,6 +80,14 @@ namespace NewHorizons.Components
|
|||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
|
if (_planet == null || !_planet.activeSelf)
|
||||||
|
{
|
||||||
|
_outOfRange = false;
|
||||||
|
ToggleRendering(false);
|
||||||
|
enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_stellarRemnant != null)
|
if (_stellarRemnant != null)
|
||||||
{
|
{
|
||||||
if (_stellarRemnant.IsActiveAndEnabled())
|
if (_stellarRemnant.IsActiveAndEnabled())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user