diff --git a/Assets/Mirror/Core/NetworkIdentity.cs b/Assets/Mirror/Core/NetworkIdentity.cs index 02b73bc45..f0d8fdfbf 100644 --- a/Assets/Mirror/Core/NetworkIdentity.cs +++ b/Assets/Mirror/Core/NetworkIdentity.cs @@ -244,6 +244,16 @@ internal void HandleRemoteCall(byte componentIndex, ushort functionHash, RemoteC } } + // RuntimeInitializeOnLoadMethod -> fast playmode without domain reload + // internal so it can be called from NetworkServer & NetworkClient + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] + internal static void ResetStatics() + { + // reset ALL statics + ResetClientStatics(); + ResetServerStatics(); + } + // reset only client sided statics. // don't touch server statics when calling StopClient in host mode. // https://github.com/vis2k/Mirror/issues/2954 @@ -258,16 +268,6 @@ internal static void ResetServerStatics() nextNetworkId = 1; } - // RuntimeInitializeOnLoadMethod -> fast playmode without domain reload - // internal so it can be called from NetworkServer & NetworkClient - [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] - internal static void ResetStatics() - { - // reset ALL statics - ResetClientStatics(); - ResetServerStatics(); - } - /// Gets the NetworkIdentity from the sceneIds dictionary with the corresponding id public static NetworkIdentity GetSceneIdentity(ulong id) => sceneIds[id];