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 ++; } } }
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...
Ich versuche ein einfaches Skript zu erstellen, in dem es eine Excel -Datei liest und eine bestimmte Spalte daraus liest. So wie es jetzt ist, liest es eine bestimmte Datei, aber ich möchte, dass es...
Ich bin mir nicht sicher, wie ich das mit einer MySQL-Abfrage erreichen kann:
Ich habe eine Liste mit Anzeigen, die von mehreren Benutzern gepostet wurden, und einige Benutzer posten mehrere Anzeigen...
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 : [email protected]...
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...