Skip to content

Commit 970a89e

Browse files
authored
删除下载的目标文件
1 parent 8c2a478 commit 970a89e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

GameFramework/Runtime/WebRequest/WebRequestBehaviourHelper.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ private IEnumerator WebRequestAssetBundle(string url, Action<AssetBundle> callba
167167
private IEnumerator WebRequestDownloadFile(string remoteUrl, string localPath, Action<string, bool,ulong, float> callback,Action<string,string> errorCallback)
168168
{
169169
yield return null;
170+
171+
//删除本地文件
172+
if (File.Exists(localPath))
173+
{
174+
File.Delete(localPath);
175+
}
170176

171177
using (UnityWebRequest request = UnityWebRequest.Get(remoteUrl))
172178
{
@@ -197,4 +203,4 @@ private IEnumerator WebRequestDownloadFile(string remoteUrl, string localPath, A
197203
}
198204
#endregion
199205
}
200-
}
206+
}

0 commit comments

Comments
 (0)