public void TickNonMultithreaded() { // Process paths if (threadCoroutine != null) { try { threadCoroutine.MoveNext(); } catch (System.Exception e) { //This will kill pathfinding threadCoroutine = null; // Queue termination exceptions should be ignored, they are supposed to kill the thread if (!(e is ThreadControlQueue.QueueTerminationException)) { Debug.LogException(e); Debug.LogError("Unhandled exception during pathfinding. Terminating."); queue.TerminateReceivers(); // This will throw an exception supposed to kill the thread try { queue.PopNoBlock(false); } catch {} } } } }