I am simply trying to find out the type of ArgumentOutOfRangeException. I have a coroutine where I Destroy() a certain object, but under some circumstances I have to restart the coroutine before it's completion. I do call the StopCoroutine() on it, before restarting, but it still doesn't seem to do the tick. So in the console it Logs the error ArgumentOutOfRange.
I tried
try {
Destroy(foo.gameObject);
}catch(UnassignedReferenceException exception){
Debug.LogException(exception, foo);
Debug.Log("Exception throw because two simultaneous coroutines tried to destroy same waypoint object");
}
but it still keeps logging the same error.
↧