You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, if you turn off Unity's Domain Reloading checkbox, you'll get duplicate listeners on your SignalHub because it's not getting refreshed between play modes.
I made a simple change in my project that fixes this:
First, add a using statement for UnityEditor when you're in the editor:
#if UNITY_EDITOR
using UnityEditor;
#endif
Then, in the static Signals class, replace the hub initialization line with this:
This requires removing the readonly keyword from the static hub, but it's already private in a small static class, so nothing else can get to it and reset it anyway.
This will make sure that the static hub gets re-initialized on play mode enter even if domain reloading is turned off.
The text was updated successfully, but these errors were encountered:
Right now, if you turn off Unity's Domain Reloading checkbox, you'll get duplicate listeners on your SignalHub because it's not getting refreshed between play modes.
I made a simple change in my project that fixes this:
First, add a using statement for UnityEditor when you're in the editor:
Then, in the static Signals class, replace the hub initialization line with this:
This requires removing the readonly keyword from the static hub, but it's already private in a small static class, so nothing else can get to it and reset it anyway.
This will make sure that the static hub gets re-initialized on play mode enter even if domain reloading is turned off.
The text was updated successfully, but these errors were encountered: