BeardedManStudios / ForgeNetworkingRemastered

See various forks, also please join the Forge Community fork of Forge Alloy! -> https://github.com/ForgeAlloyCommunity/ForgeAlloy
https://twitter.com/FarrisFaulds
Apache License 2.0
1.49k stars 311 forks source link

Fix for Unity's Configurable Enter Play Mode #365

Closed mattnewport closed 4 years ago

mattnewport commented 4 years ago

When Unity's experimental Configurable Enter Play Mode (https://docs.unity3d.com/2019.3/Documentation/Manual/ConfigurableEnterPlayMode.html) is enabled static fields are not reinitialized to null.

This change makes Forge compatible with Configurable Enter Play Mode by clearing the static singleton _instance field when the MainThreadManager is destroyed on exiting play mode.

phalasz commented 4 years ago

Hey, thanks for this. Could you please submit this against the develop branch?

mattnewport commented 4 years ago

Created a new PR targeting develop branch https://github.com/BeardedManStudios/ForgeNetworkingRemastered/pull/366