可以用unitywebrequest 也可以用www,我用的是File.Copy(str1,str2),里面有個(gè)坑的bug,就是在拷貝的時(shí)候一定要將文件名傳入要拷貝的文件夾中,代碼如下。
public static void CopyFloder(string sourcepath, string despath)
? ? {
? ? ? ? DirectoryInfo direction = new DirectoryInfo(sourcepath);
? ? ? ? FileInfo[] files = direction.GetFiles("*", SearchOption.AllDirectories);
? ? ? ? Debug.Log("=====ab文件長(zhǎng)度:? " + files.Length);
? ? ? ? for (int i = 0; i < files.Length; i++)
? ? ? ? {
? ? ? ? ? ? if (files[i].Name.EndsWith(".meta"))
? ? ? ? ? ? {
? ? ? ? ? ? ? ? continue;
? ? ? ? ? ? }
? ? ? ? ? ? string FilePath = sourcepath + "/" + files[i].Name;
? ? ? ? ? ? string desspath = despath + "/" + files[i].Name;
? ? ? ? ? ? File.Copy(FilePath, desspath, true);
? ? ? ? }
? ? }
里面的sourcepath路徑是ab資源的路徑;despath是要拷貝到的路徑,desspath是要拷貝的路徑+文件名的路徑,切記切記 要不就會(huì)報(bào)錯(cuò):說(shuō)是一個(gè)目錄,

可能是我比較菜,用的比較少 所以覺(jué)得比較坑,但還是想說(shuō)一句......
