问题
A few moments ago I posted a question because I wasn't able to download a file using WWW() but now I've come to a new problem:
The file that has to be downloaded is ~127mb in size. When I check the file that has been downloaded it shows 55mb. (Which explains why the file isn't able to be opened).
The code I'm using to download the file:
IEnumerator WaitForGame(){
WWW www = new WWW("https://www.dropbox.com/sh/aayo9iud7t98hgb/AACDqSST_-rT2jIfxq1Zc2SXa?dl=1");
Debug.Log ("Downloading");
yield return www;
byte[] yourBytes = www.bytes;
System.IO.File.WriteAllBytes(FullPath, yourBytes);
Debug.Log ("Done downloading!");
}
void UpdateGame(){
string path = Application.dataPath;
if (Application.platform == RuntimePlatform.OSXPlayer) {
path += "/../../";
}
else if (Application.platform == RuntimePlatform.WindowsPlayer) {
path += "/../";
}
if (System.IO.File.Exists (path+"/Apo_Alpha.app")) {
Debug.Log ("File exists!");
System.IO.File.Delete (path+"/Apo_Alpha.app");
}
FullPath = path + "/Apo_Alpha.app";
StartCoroutine (WaitForGame ());
}
I have no clue to what the problem can be, and it would be great if someone could help me out with this one.
来源:https://stackoverflow.com/questions/42455838/unity-file-wwwurl-not-retrieving-all-bytes