Change EventManager DelListener
This commit is contained in:
parent
bc6e1a3fd3
commit
84e34e84fd
|
@ -34,16 +34,17 @@ namespace FirstVillain.Event
|
||||||
if (_delegateDict.TryGetValue(type, out EventDelegate tempDelegate))
|
if (_delegateDict.TryGetValue(type, out EventDelegate tempDelegate))
|
||||||
{
|
{
|
||||||
tempDelegate -= targetDelegate;
|
tempDelegate -= targetDelegate;
|
||||||
if (tempDelegate == null)
|
if (tempDelegate.GetInvocationList().Length == 0)
|
||||||
{
|
{
|
||||||
_delegateDict.Remove(type);
|
_delegateDict.Remove(type);
|
||||||
_delegateLookupDict.Remove(callback);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_delegateDict[type] = tempDelegate;
|
_delegateDict[type] = tempDelegate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_delegateLookupDict.Remove(callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user