When using UnityWebRequest to load from the local filesystem:
file:⁄⁄
be prepended to the location.file:⁄⁄
prepended.file:⁄⁄
, but will tolerate it.
To ensure that UnityWebRequest operations are completed even if the MonoBehaviour is being destroyed (e.g. when the game is exiting), it appears to be safe on at least some platforms (such as Windows) to manually wait in a loop inside OnDestroy
for isDone == true
on the [UnityWebRequest]AsyncOperation
object returned by Send[WebRequest]
.
System.Diagnostics.Stopwatch
should be used for that since Time
properties will not be updated and DateTime.UtcNow
output can be changed by the user/system.