mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 01:13:05 +00:00
remove event listeners in server/client state managers
This commit is contained in:
parent
9089b5f2a3
commit
d27113a4f3
@ -3,6 +3,7 @@ using QSB.Messaging;
|
||||
using QSB.Player;
|
||||
using QSB.Player.TransformSync;
|
||||
using QSB.Utility;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.ClientServerStateSync
|
||||
@ -24,6 +25,9 @@ namespace QSB.ClientServerStateSync
|
||||
() => new ClientStateMessage(ForceGetCurrentState()).Send());
|
||||
}
|
||||
|
||||
private void OnDestroy() =>
|
||||
QSBSceneManager.OnSceneLoaded -= OnSceneLoaded;
|
||||
|
||||
public void SendChangeClientStateMessage(ClientState newState)
|
||||
{
|
||||
ChangeClientState(newState);
|
||||
|
@ -4,6 +4,7 @@ using QSB.Messaging;
|
||||
using QSB.Player;
|
||||
using QSB.Player.TransformSync;
|
||||
using QSB.Utility;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
@ -36,6 +37,12 @@ namespace QSB.ClientServerStateSync
|
||||
() => new ServerStateMessage(ForceGetCurrentState()).Send());
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
QSBSceneManager.OnSceneLoaded -= OnSceneLoaded;
|
||||
GlobalMessenger.RemoveListener("TriggerSupernova", OnTriggerSupernova);
|
||||
}
|
||||
|
||||
public void SendChangeServerStateMessage(ServerState newState)
|
||||
{
|
||||
ChangeServerState(newState);
|
||||
|
Loading…
Reference in New Issue
Block a user