Verwenden von Unity Web Request kann ich einen Download starten, das Quest -Headset abnehmen und dieser Download wird fertig sein. Es wird den nächsten Download nicht speichern oder starten. Wie könnte ich das schaffen? Entweder indem das Headset wach bleibt oder Skripte ausgeführt wird, obwohl das Headset ausgeschaltet wurde.
IEnumerator DownloadAllVideosSequentially()
{
//count how many missing files
//TODO: Maybe it would be better to store this earlier on than loop through the videos again
//Loop through files to call downloads
int totalMissing = numberOfMissingVids; //missing vids is updated each successful download, whereas we want this to remain showing the total
int missingCounter = 1;
for (int i = 0; i < numberOfVideos; i++) {
if (!videos[i].Downloaded) {
Debug.Log($"Downloading {videos[i].FileName} from {videos[i].OnlinePath}");
downloadStatusText.text = $"Downloading file {missingCounter} of {totalMissing}... 0%";
yield return StartCoroutine(DownloadVideo(videos[i]));
missingCounter ++;
}
}
}
IEnumerator DownloadVideo(VideoData video) {
UnityWebRequest uwr = UnityWebRequest.Get(video.OnlinePath);
uwr.SendWebRequest();
while (!uwr.isDone) {
imageIndicator.fillAmount = uwr.downloadProgress;
downloadStatusText.text = $"{downloadStatusText.text.Substring(0, downloadStatusText.text.Length-3)}{((int)(uwr.downloadProgress * 100)).ToString("00")}%";
yield return null;
}
if (uwr.result != UnityWebRequest.Result.Success) {
Debug.LogError("Download error: " + uwr.error);
downloadStatusText.text = "Download failed!";
}
else {
string savePath = Path.Combine(Application.persistentDataPath, video.FileName);
downloadStatusText.text = $"Saving {video.FileName}";
File.WriteAllBytes(savePath, uwr.downloadHandler.data);
numberOfMissingVids --;
Debug.Log($"{video.FileName} saved to {savePath}");
video.SetFinalPath(savePath);
video.SetDownloaded(true);
}
uwr.Dispose();
}
Verwenden von Unity Web Request kann ich einen Download starten, das Quest -Headset abnehmen und dieser Download wird fertig sein. Es wird den nächsten Download nicht speichern oder starten. Wie könnte ich das schaffen? Entweder indem das Headset wach bleibt oder Skripte ausgeführt wird, obwohl das Headset ausgeschaltet wurde.[code]IEnumerator DownloadAllVideosSequentially() { //count how many missing files //TODO: Maybe it would be better to store this earlier on than loop through the videos again
//Loop through files to call downloads int totalMissing = numberOfMissingVids; //missing vids is updated each successful download, whereas we want this to remain showing the total int missingCounter = 1; for (int i = 0; i < numberOfVideos; i++) { if (!videos[i].Downloaded) { Debug.Log($"Downloading {videos[i].FileName} from {videos[i].OnlinePath}"); downloadStatusText.text = $"Downloading file {missingCounter} of {totalMissing}... 0%"; yield return StartCoroutine(DownloadVideo(videos[i])); missingCounter ++; } } }
Problem:
Wenn ich versuche, einen Benutzer zu registrieren, indem ich eine Postanforderung an den Endpunkt/Register mit einer Nutzlast wie folgt sende:
{
username : asas ,
email : asas@gmail.com...
Ich versuche nur, historische Schlusspreise für bestimmte Ticker herunterzuladen, die in einer .csv -Datei gefunden wurden. Ich habe jedoch Probleme damit, dass YFInance aus irgendeinem bizarren...
Auf einem Redhat -System, das Maven 3.0.3 ausführt, werden bestimmte Artefakte mit dem Zeitstempel anstelle des -snapshots heruntergeladen. a-2.3.0-20140206.210030-51.jar...
Ich implementiere Unterstützung für wieder aufgenommene Downloads mit der Wiederaufnahme von URLSession . Ich möchte die wiederaufnahme auf der Festplatte speichern und dann mit dem Versuch erneut...
Ich habe eine PHP-Website, die von meinem Raspberry Pi 4 mit 8 GB RAM und Apache2 gehostet wird. Es ist nur eine Website, die die Uhrzeit anzeigt, während im Hintergrund Videos abgespielt werden. Die...