mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Remove player blink listener on destroy
This commit is contained in:
parent
dfc7798cd7
commit
d5a87b968f
@ -34,7 +34,7 @@ namespace NewHorizons.Components.Quantum
|
||||
_rb = GetComponent<OWRigidbody>();
|
||||
_orbitLine = GetComponent<OrbitLine>();
|
||||
|
||||
GlobalMessenger.AddListener("PlayerBlink", new Callback(OnPlayerBlink));
|
||||
GlobalMessenger.AddListener("PlayerBlink", OnPlayerBlink);
|
||||
|
||||
_maxSnapshotLockRange = 300000f;
|
||||
}
|
||||
@ -51,6 +51,13 @@ namespace NewHorizons.Components.Quantum
|
||||
ChangeQuantumState(true);
|
||||
}
|
||||
|
||||
public override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
GlobalMessenger.RemoveListener("PlayerBlink", OnPlayerBlink);
|
||||
}
|
||||
|
||||
public int GetRandomNewState()
|
||||
{
|
||||
var range = Enumerable.Range(0, states.Count).Where(i => i != CurrentIndex);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user