mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Waah wah im Idiot and i dont like get component
This commit is contained in:
parent
779f9fc9b0
commit
abfe068cc8
@ -19,24 +19,37 @@ namespace NewHorizons.Components.Orbital
|
|||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
if (Primary == null || Secondary == null) return;
|
if (Primary == null || Secondary == null)
|
||||||
|
{
|
||||||
|
CleanUp();
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Secondary and primary must have been engulfed by a star
|
// Secondary and primary must have been engulfed by a star
|
||||||
if (!Primary.isActiveAndEnabled && !Secondary.isActiveAndEnabled)
|
if (!Primary.isActiveAndEnabled && !Secondary.isActiveAndEnabled)
|
||||||
{
|
{
|
||||||
ReferenceFrameTracker component = Locator.GetPlayerBody().GetComponent<ReferenceFrameTracker>();
|
CleanUp();
|
||||||
if (component.GetReferenceFrame(true) != null && component.GetReferenceFrame(true).GetOWRigidBody() == gameObject)
|
gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CleanUp()
|
||||||
|
{
|
||||||
|
ReferenceFrameTracker component = Locator.GetPlayerBody()?.GetComponent<ReferenceFrameTracker>();
|
||||||
|
if (component?.GetReferenceFrame(true)?.GetOWRigidBody() == gameObject)
|
||||||
{
|
{
|
||||||
component.UntargetReferenceFrame();
|
component.UntargetReferenceFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
MapMarker component2 = gameObject.GetComponent<MapMarker>();
|
MapMarker component2 = gameObject.GetComponent<MapMarker>();
|
||||||
if (component2 != null)
|
if (component2 != null)
|
||||||
{
|
{
|
||||||
component2.DisableMarker();
|
component2.DisableMarker();
|
||||||
}
|
}
|
||||||
gameObject.SetActive(false);
|
|
||||||
FakeMassBody.SetActive(false);
|
FakeMassBody.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user