示例#1
0
    public static void RemoveListener(NetEventType type, UnityAction <NetEventArgs> listener)
    {
        if (!instance)
        {
            return;
        }

        NetworkEvent e = null;

        if (instance.events.TryGetValue(type, out e))
        {
            e.RemoveListener(listener);
            if (e.GetPersistentEventCount() == 0)
            {
                instance.events.Remove(type);
            }
        }
    }