unitywebrequest
Table of Contents
UnityWebRequest
Local Filesystem Requests
When using UnityWebRequest to load from the local filesystem:
- macOS and iOS require that
file:⁄⁄be prepended to the location. - Android must not have
file:⁄⁄prepended. - Windows does not require
file:⁄⁄, but will tolerate it.
Sending requests during destruction
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].
- Note however that mobile platforms don't provide destruction callbacks at all and will usually simply kill the process.
- It is recommended to limit the maximum running time of such a loop, and an appropriate time measurement method like
System.Diagnostics.Stopwatchshould be used for that sinceTimeproperties will not be updated andDateTime.UtcNowoutput can be changed by the user/system.Plugin Backlinks: Nothing was found.
unitywebrequest.txt · Last modified: 2025/01/15 04:35 by 127.0.0.1