update file system

IFileSystem新增ReadFileData方法
This commit is contained in:
何冠峰
2024-07-08 17:36:25 +08:00
parent d2b38cbc1b
commit b0ce14dc0e
15 changed files with 150 additions and 68 deletions

View File

@@ -303,6 +303,23 @@ namespace YooAsset
return Exists(bundle) == false;
}
public virtual byte[] ReadFileData(PackageBundle bundle)
{
if (Exists(bundle) == false)
return null;
string filePath = GetCacheFileLoadPath(bundle);
return FileUtility.ReadAllBytes(filePath);
}
public virtual string ReadFileText(PackageBundle bundle)
{
if (Exists(bundle) == false)
return null;
string filePath = GetCacheFileLoadPath(bundle);
return FileUtility.ReadAllText(filePath);
}
#region
private readonly BufferWriter _sharedBuffer = new BufferWriter(1024);
public void WriteInfoFile(string filePath, string dataFileCRC, long dataFileSize)
@@ -368,7 +385,7 @@ namespace YooAsset
}
return filePath;
}
public string GetFileLoadPath(PackageBundle bundle)
public string GetCacheFileLoadPath(PackageBundle bundle)
{
return GetDataFilePath(bundle);
}