NetworkBehaviour.ClearDelegates added for tests

This commit is contained in:
vis2k 2020-02-24 15:30:26 +01:00
parent ed9d056350
commit 31af385a70

View File

@ -409,6 +409,13 @@ protected static void RegisterEventDelegate(Type invokeClass, string eventName,
RegisterDelegate(invokeClass, eventName, MirrorInvokeType.SyncEvent, func);
}
// we need a way to clean up delegates after tests
[EditorBrowsable(EditorBrowsableState.Never)]
internal static void ClearDelegates()
{
cmdHandlerDelegates.Clear();
}
static bool GetInvokerForHash(int cmdHash, MirrorInvokeType invokeType, out Invoker invoker)
{
if (cmdHandlerDelegates.TryGetValue(cmdHash, out invoker) &&