mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix orbit lines with quantum planets
This commit is contained in:
parent
b5ececeed2
commit
7e0a9b1e76
@ -21,7 +21,8 @@ namespace NewHorizons.Components.Quantum
|
||||
private ConstantForceDetector _detector;
|
||||
private AlignWithTargetBody _alignment;
|
||||
private OWRigidbody _rb;
|
||||
private OrbitLine _orbitLine;
|
||||
private NHOrbitLine _nhOrbitLine;
|
||||
private TrackingOrbitLine _trackingOrbitLine;
|
||||
private QuantumStructure[] _structures = new QuantumStructure[0];
|
||||
private QuantumDarkTrigger[] _darkTriggers = new QuantumDarkTrigger[0];
|
||||
private int _collapseToState = -1;
|
||||
@ -60,7 +61,6 @@ namespace NewHorizons.Components.Quantum
|
||||
_detector = GetComponentInChildren<ConstantForceDetector>();
|
||||
_alignment = GetComponent<AlignWithTargetBody>();
|
||||
_rb = GetComponent<OWRigidbody>();
|
||||
_orbitLine = GetComponent<OrbitLine>();
|
||||
|
||||
GlobalMessenger.AddListener("PlayerBlink", OnPlayerBlink);
|
||||
|
||||
@ -70,11 +70,19 @@ namespace NewHorizons.Components.Quantum
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
Delay.FireOnNextUpdate(PostStart);
|
||||
|
||||
base.Start();
|
||||
|
||||
ResetStates(true);
|
||||
}
|
||||
|
||||
private void PostStart()
|
||||
{
|
||||
_nhOrbitLine = GetComponentInChildren<NHOrbitLine>();
|
||||
_trackingOrbitLine = GetComponentInChildren<TrackingOrbitLine>();
|
||||
}
|
||||
|
||||
public void ResetStates(bool changeState)
|
||||
{
|
||||
_structures = GetComponentsInChildren<QuantumStructure>(true); // finds all quantum structures
|
||||
@ -220,14 +228,14 @@ namespace NewHorizons.Components.Quantum
|
||||
|
||||
_rb.SetVelocity(orbitalParameters.InitialVelocity + primaryBody.GetAttachedOWRigidbody().GetVelocity());
|
||||
|
||||
if (_orbitLine is NHOrbitLine nhOrbitLine)
|
||||
if (_nhOrbitLine != null)
|
||||
{
|
||||
nhOrbitLine.SetFromParameters(orbitalParameters);
|
||||
_nhOrbitLine.SetFromParameters(orbitalParameters);
|
||||
}
|
||||
|
||||
if (_orbitLine is TrackingOrbitLine trackingOrbitLine)
|
||||
if (_trackingOrbitLine != null)
|
||||
{
|
||||
trackingOrbitLine.Reset();
|
||||
_trackingOrbitLine.Reset();
|
||||
}
|
||||
|
||||
foreach (var structure in _structures)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user