mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Disconnect transmitter OnReceiveWarpedBody event when destroyed
This commit is contained in:
parent
f0f24b2777
commit
2509750c6b
@ -16,6 +16,14 @@ namespace NewHorizons.Components
|
||||
_transmitter.OnReceiveWarpedBody += _transmitter_OnReceiveWarpedBody;
|
||||
}
|
||||
|
||||
public void OnDestroy()
|
||||
{
|
||||
if (_transmitter != null)
|
||||
{
|
||||
_transmitter.OnReceiveWarpedBody -= _transmitter_OnReceiveWarpedBody;
|
||||
}
|
||||
}
|
||||
|
||||
private void _transmitter_OnReceiveWarpedBody(OWRigidbody warpedBody, NomaiWarpPlatform startPlatform, NomaiWarpPlatform targetPlatform)
|
||||
{
|
||||
_cooldownActive = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user