Unity 文件(文件夹)操作
private static void CopyFile(string sourcePath,string targetPath)
{
FileInfo fileinfo = new FileInfo(targetPath);
if (File.Exists(sourcePath)){
if (!fileinfo.Directory.Exists){
fileinfo.Directory.Create();
}
File.Copy(sourcePath, targetPath,true);
}
}
private static void DeleteDirectory(DirectoryInfo directoryInfo)
{
DirectoryInfo[] directoryInfos = directoryInfo.GetDirectories();
FileInfo[] fileInfos = directoryInfo.GetFiles();
for (int i = 0; i < directoryInfos.Length;i++ ){
DeleteDirectory(directoryInfos[i]);
}
for