Update runtime code

This commit is contained in:
hevinci
2022-11-01 23:02:20 +08:00
parent bdc8285255
commit b5f2174ed0
5 changed files with 58 additions and 29 deletions

View File

@@ -148,6 +148,27 @@ namespace YooAsset
}
}
/// <summary>
/// 创建文件(如果已经存在则删除旧文件)
/// </summary>
public static void CreateFile(string filePath, byte[] data)
{
// 删除旧文件
if (File.Exists(filePath))
File.Delete(filePath);
// 创建文件夹路径
CreateFileDirectory(filePath);
// 创建新文件
using (FileStream fs = File.Create(filePath))
{
fs.Write(data, 0, data.Length);
fs.Flush();
fs.Close();
}
}
/// <summary>
/// 创建文件的文件夹路径
/// </summary>