///Nodes can use coroutine as normal through MonoManager.
publicvoidStopCoroutine(Coroutine routine){
MonoManager.current?.StopCoroutine(routine);
}
The problem:
C#’s ?. operator doesn’t work with Unity Objects (UnityEngine.Object). So instead of backing off if MonoManager.current is null, this code is executed anyway, then triggers the UnityException above.
Note:
The list of problem areas isn’t exhaustive. Just what I noticed; I think a more thorough approach (EG “Find All”) is a good idea.
Left this out of the original post, but: this only happens when Unity is unloading everything when exiting play mode, so it causes a flood of exceptions in the console that don’t mean anything but can hide other errors none-the-less.