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
The code heavily expects statics to be cleared between runs, which breaks when you use the faster Play Mode in newer versions of Unity. I have tried to fix this myself but none of my attempts worked (hence the issue instead of a PR, sorry).
I was testing with both Domain and Scene reload disabled.
If it helps anyone, the problem seems to be in ContinuationProcessorGroup.Add():
var p = ContinuationProcessor<T>.instance;
if(p == null)
{
p = ContinuationProcessor<T>.instance = new ContinuationProcessor<T>(InitialCapacity);
processors.Add(ContinuationProcessor<T>.instance);
}
The static variable ContinuationProcessor<T>.instance isn't reset to null when domain reload is disabled, and therefore isn't added to the new processors list. One solution might be to add a variable to ContinuationProcessor that you could check to see if it's from a previous play session.
Thanks for investigating this. Looks like we need to hook into [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] and reset all static fields to resolve this. I'm not on the right computer to push any code but for future reference, adding something like...
The code heavily expects
static
s to be cleared between runs, which breaks when you use the faster Play Mode in newer versions of Unity. I have tried to fix this myself but none of my attempts worked (hence the issue instead of a PR, sorry).I was testing with both Domain and Scene reload disabled.
Reference: https://docs.unity3d.com/Manual/ConfigurableEnterPlayMode.html
The text was updated successfully, but these errors were encountered: