Example #1
0
 private static void RemoveEventListeners()
 {
     connectResponseEvent.RemoveListener(OnConnect);
     disconnectResponseEvent.RemoveListener(OnDisconnect);
     joinRoomResponseEvent.RemoveListener(OnJoinRoom);
     leaveRoomResponseEvent.RemoveListener(OnLeaveRoom);
     roomListResponseEvent.RemoveListener(OnRoomListReceived);
     customMessageResponseEvent.RemoveListener(OnCustomMessage);
 }
Example #2
0
        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);
 }
Example #6
0
 private void OnDisable()
 {
     debugEvent.RemoveListener(Debug);
 }