Use activated

This commit is contained in:
Noah Pilarski 2022-08-18 22:56:04 -04:00
parent f3a1e38f40
commit c2f3b0d8f7
3 changed files with 10 additions and 4 deletions

View File

@ -90,7 +90,7 @@ namespace NewHorizons.Components
if (_stellarRemnant != null) if (_stellarRemnant != null)
{ {
if (_stellarRemnant.IsActiveAndEnabled()) if (_stellarRemnant.IsActivated())
{ {
_realObjectDiameter = _stellarRemnant._realObjectDiameter; _realObjectDiameter = _stellarRemnant._realObjectDiameter;
if (!_stellarRemnant.IsRenderingOn()) ToggleRendering(_outOfRange); if (!_stellarRemnant.IsRenderingOn()) ToggleRendering(_outOfRange);
@ -110,7 +110,7 @@ namespace NewHorizons.Components
if (_stellarRemnant != null) if (_stellarRemnant != null)
{ {
_stellarRemnant.ToggleRendering(on); _stellarRemnant.ToggleRendering(on);
on = on && !_stellarRemnant.IsActiveAndEnabled(); on = on && !_stellarRemnant.IsActivated();
} }
base.ToggleRendering(on); base.ToggleRendering(on);

View File

@ -11,6 +11,8 @@ namespace NewHorizons.Components
{ {
private StellarRemnantType _type = StellarRemnantType.Default; private StellarRemnantType _type = StellarRemnantType.Default;
private bool _activated;
private StarEvolutionController _starEvolutionController; private StarEvolutionController _starEvolutionController;
private StellarRemnantProxy _proxy; private StellarRemnantProxy _proxy;
@ -68,6 +70,10 @@ namespace NewHorizons.Components
} }
if (_starController != null) StarLightController.AddStar(_starController); if (_starController != null) StarLightController.AddStar(_starController);
_activated = true;
} }
public bool IsActivated() => _activated;
} }
} }

View File

@ -62,7 +62,7 @@ namespace NewHorizons.Components
public void ToggleRendering(bool on) public void ToggleRendering(bool on)
{ {
on = on && IsActiveAndEnabled(); on = on && IsActivated();
_renderingOn = on; _renderingOn = on;
@ -146,7 +146,7 @@ namespace NewHorizons.Components
controller.SetProxy(this); controller.SetProxy(this);
} }
public bool IsActiveAndEnabled() => _stellarRemnantController.isActiveAndEnabled; public bool IsActivated() => _stellarRemnantController.IsActivated();
public bool IsRenderingOn() => _renderingOn; public bool IsRenderingOn() => _renderingOn;
} }
} }