private static void RemoveEventListeners() { connectResponseEvent.RemoveListener(OnConnect); disconnectResponseEvent.RemoveListener(OnDisconnect); joinRoomResponseEvent.RemoveListener(OnJoinRoom); leaveRoomResponseEvent.RemoveListener(OnLeaveRoom); roomListResponseEvent.RemoveListener(OnRoomListReceived); customMessageResponseEvent.RemoveListener(OnCustomMessage); }
public static void StopListeningStringEvent(string eventName, UnityAction <string> listener) { Init(); StringEvent thisStringEvent = null; if (stringEventDictionary.TryGetValue(eventName, out thisStringEvent)) { thisStringEvent.RemoveListener(listener); } }
public static void StopListening(string eventName, UnityAction <string> listener) { if (eventManager == null) { return; } StringEvent thisEvent = null; if (Instance.stringEventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public static void AddOnce(this StringEvent thisEvent, UnityAction <string> reciever) { thisEvent.RemoveListener(reciever); thisEvent.AddListener(reciever); }
public void RemoveOnDataReceivedListener(UnityAction <string> listener) { onDataReceived?.RemoveListener(listener); }
private void OnDisable() { debugEvent.RemoveListener(Debug); }