Compare commits

..

2 Commits

Author SHA1 Message Date
MichaelO
e984d69c48 Merge 0b4f6d6639 into 4d2df5b705 2025-03-13 18:59:05 +08:00
MichaelO
0b4f6d6639 Updated to use StreamingAssets to request BuildinCatalog.json 2025-03-12 19:07:41 +08:00
43 changed files with 276 additions and 622 deletions

View File

@@ -2,26 +2,6 @@
All notable changes to this package will be documented in this file. All notable changes to this package will be documented in this file.
## [2.3.6] - 2025-03-25
### Improvements
- 构建管线新增了TaskCreateCatalog任务节点。
- 内置文件系统的catalog文件现在存储在streammingAssets目录下。
### Fixed
- (#486) 修复了微信小游戏文件系统调用ClearUnusedBundleFiles时候的异常。
## [2.3.5-preview] - 2025-03-14
### Fixed
- (#502) 修复了原生缓存文件由于文件格式变动导致的加载本地缓存文件失败的问题。
- (#504) 修复了MacOS平台Offline Play Mode模式请求本地资源清单失败的问题。
- (#506) 修复了v2.3x版本LoadAllAssets方法计算依赖Bundle不完整的问题。
- (#506) 修复了微信小游戏文件系统在启用加密算法后卸载bundle报错的问题。
## [2.3.4-preview] - 2025-03-08 ## [2.3.4-preview] - 2025-03-08
### Improvements ### Improvements

View File

@@ -1,23 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
namespace YooAsset.Editor
{
public class TaskCreateCatalog
{
/// <summary>
/// 生成内置资源记录文件
/// </summary>
internal void CreateCatalogFile(BuildParametersContext buildParametersContext)
{
string buildinRootDirectory = buildParametersContext.GetBuildinRootDirectory();
string buildPackageName = buildParametersContext.Parameters.PackageName;
DefaultBuildinFileSystemBuild.CreateBuildinCatalogFile(buildPackageName, buildinRootDirectory);
// 刷新目录
AssetDatabase.Refresh();
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 2d2c835e5e40ca34d93480587c8125df
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -30,7 +30,7 @@ namespace YooAsset.Editor
// 创建新补丁清单 // 创建新补丁清单
PackageManifest manifest = new PackageManifest(); PackageManifest manifest = new PackageManifest();
manifest.FileVersion = ManifestDefine.FileVersion; manifest.FileVersion = YooAssetSettings.ManifestFileVersion;
manifest.EnableAddressable = buildMapContext.Command.EnableAddressable; manifest.EnableAddressable = buildMapContext.Command.EnableAddressable;
manifest.LocationToLower = buildMapContext.Command.LocationToLower; manifest.LocationToLower = buildMapContext.Command.LocationToLower;
manifest.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID; manifest.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID;

View File

@@ -15,6 +15,7 @@ namespace YooAsset.Editor
if (buildParametersContext.Parameters.BuildinFileCopyOption != EBuildinFileCopyOption.None) if (buildParametersContext.Parameters.BuildinFileCopyOption != EBuildinFileCopyOption.None)
{ {
CopyBuildinFilesToStreaming(buildParametersContext, manifestContext.Manifest); CopyBuildinFilesToStreaming(buildParametersContext, manifestContext.Manifest);
DefaultBuildinFileSystemBuild.ExportBuildinCatalogFile();
} }
} }
} }

View File

@@ -1,20 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace YooAsset.Editor
{
public class TaskCreateCatalog_BBP : TaskCreateCatalog, IBuildTask
{
void IBuildTask.Run(BuildContext context)
{
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
if (buildParametersContext.Parameters.BuildinFileCopyOption != EBuildinFileCopyOption.None)
{
CreateCatalogFile(buildParametersContext);
}
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 8fe3d00b03dc9c64a96b7acfdf99b54c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -36,7 +36,6 @@ namespace YooAsset.Editor
new TaskCreateReport_BBP(), new TaskCreateReport_BBP(),
new TaskCreatePackage_BBP(), new TaskCreatePackage_BBP(),
new TaskCopyBuildinFiles_BBP(), new TaskCopyBuildinFiles_BBP(),
new TaskCreateCatalog_BBP()
}; };
return pipeline; return pipeline;
} }

View File

@@ -16,6 +16,7 @@ namespace YooAsset.Editor
if (buildParameters.BuildinFileCopyOption != EBuildinFileCopyOption.None) if (buildParameters.BuildinFileCopyOption != EBuildinFileCopyOption.None)
{ {
CopyBuildinFilesToStreaming(buildParametersContext, manifestContext.Manifest); CopyBuildinFilesToStreaming(buildParametersContext, manifestContext.Manifest);
DefaultBuildinFileSystemBuild.ExportBuildinCatalogFile();
} }
} }
} }

View File

@@ -1,20 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace YooAsset.Editor
{
public class TaskCreateCatalog_RFBP : TaskCreateCatalog, IBuildTask
{
void IBuildTask.Run(BuildContext context)
{
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
if (buildParametersContext.Parameters.BuildinFileCopyOption != EBuildinFileCopyOption.None)
{
CreateCatalogFile(buildParametersContext);
}
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 563771ecaff17ee498b5fda7c1132e62
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -38,7 +38,6 @@ namespace YooAsset.Editor
new TaskCreateReport_RFBP(), new TaskCreateReport_RFBP(),
new TaskCreatePackage_RFBP(), new TaskCreatePackage_RFBP(),
new TaskCopyBuildinFiles_RFBP(), new TaskCopyBuildinFiles_RFBP(),
new TaskCreateCatalog_RFBP()
}; };
return pipeline; return pipeline;
} }

View File

@@ -15,6 +15,7 @@ namespace YooAsset.Editor
if (buildParametersContext.Parameters.BuildinFileCopyOption != EBuildinFileCopyOption.None) if (buildParametersContext.Parameters.BuildinFileCopyOption != EBuildinFileCopyOption.None)
{ {
CopyBuildinFilesToStreaming(buildParametersContext, manifestContext.Manifest); CopyBuildinFilesToStreaming(buildParametersContext, manifestContext.Manifest);
DefaultBuildinFileSystemBuild.ExportBuildinCatalogFile();
} }
} }
} }

View File

@@ -1,20 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace YooAsset.Editor
{
public class TaskCreateCatalog_SBP : TaskCreateCatalog, IBuildTask
{
void IBuildTask.Run(BuildContext context)
{
var buildParametersContext = context.GetContextObject<BuildParametersContext>();
if (buildParametersContext.Parameters.BuildinFileCopyOption != EBuildinFileCopyOption.None)
{
CreateCatalogFile(buildParametersContext);
}
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: d8241b1eb8e22874b84d279dae9bbd1b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -36,7 +36,6 @@ namespace YooAsset.Editor
new TaskCreateReport_SBP(), new TaskCreateReport_SBP(),
new TaskCreatePackage_SBP(), new TaskCreatePackage_SBP(),
new TaskCopyBuildinFiles_SBP(), new TaskCopyBuildinFiles_SBP(),
new TaskCreateCatalog_SBP()
}; };
return pipeline; return pipeline;
} }

View File

@@ -1,21 +0,0 @@

namespace YooAsset
{
internal class CatalogDefine
{
/// <summary>
/// 文件极限大小100MB
/// </summary>
public const int FileMaxSize = 104857600;
/// <summary>
/// 文件头标记
/// </summary>
public const uint FileSign = 0x133C5EE;
/// <summary>
/// 文件格式版本
/// </summary>
public const string FileVersion = "1.0.0";
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c6be7b8be0b51784997c959b370193e9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,102 +0,0 @@
using System;
using System.IO;
using System.Collections.Generic;
using UnityEngine;
namespace YooAsset
{
internal static class CatalogTools
{
/// <summary>
/// 序列化JSON文件
/// </summary>
public static void SerializeToJson(string savePath, DefaultBuildinFileCatalog catalog)
{
string json = JsonUtility.ToJson(catalog, true);
FileUtility.WriteAllText(savePath, json);
}
/// <summary>
/// 反序列化JSON文件
/// </summary>
public static DefaultBuildinFileCatalog DeserializeFromJson(string jsonContent)
{
return JsonUtility.FromJson<DefaultBuildinFileCatalog>(jsonContent);
}
/// <summary>
/// 序列化(二进制文件)
/// </summary>
public static void SerializeToBinary(string savePath, DefaultBuildinFileCatalog catalog)
{
using (FileStream fs = new FileStream(savePath, FileMode.Create))
{
// 创建缓存器
BufferWriter buffer = new BufferWriter(CatalogDefine.FileMaxSize);
// 写入文件标记
buffer.WriteUInt32(CatalogDefine.FileSign);
// 写入文件版本
buffer.WriteUTF8(CatalogDefine.FileVersion);
// 写入文件头信息
buffer.WriteUTF8(catalog.PackageName);
buffer.WriteUTF8(catalog.PackageVersion);
// 写入资源包列表
buffer.WriteInt32(catalog.Wrappers.Count);
for (int i = 0; i < catalog.Wrappers.Count; i++)
{
var fileWrapper = catalog.Wrappers[i];
buffer.WriteUTF8(fileWrapper.BundleGUID);
buffer.WriteUTF8(fileWrapper.FileName);
}
// 写入文件流
buffer.WriteToStream(fs);
fs.Flush();
}
}
/// <summary>
/// 反序列化(二进制文件)
/// </summary>
public static DefaultBuildinFileCatalog DeserializeFromBinary(byte[] binaryData)
{
// 创建缓存器
BufferReader buffer = new BufferReader(binaryData);
// 读取文件标记
uint fileSign = buffer.ReadUInt32();
if (fileSign != CatalogDefine.FileSign)
throw new Exception("Invalid catalog file !");
// 读取文件版本
string fileVersion = buffer.ReadUTF8();
if (fileVersion != CatalogDefine.FileVersion)
throw new Exception($"The catalog file version are not compatible : {fileVersion} != {CatalogDefine.FileVersion}");
DefaultBuildinFileCatalog catalog = new DefaultBuildinFileCatalog();
{
// 读取文件头信息
catalog.FileVersion = fileVersion;
catalog.PackageName = buffer.ReadUTF8();
catalog.PackageVersion = buffer.ReadUTF8();
// 读取资源包列表
int fileCount = buffer.ReadInt32();
catalog.Wrappers = new List<DefaultBuildinFileCatalog.FileWrapper>(fileCount);
for (int i = 0; i < fileCount; i++)
{
var fileWrapper = new DefaultBuildinFileCatalog.FileWrapper();
fileWrapper.BundleGUID = buffer.ReadUTF8();
fileWrapper.FileName = buffer.ReadUTF8();
catalog.Wrappers.Add(fileWrapper);
}
}
return catalog;
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: cf87ffe3b3de69942ac16640a330dd37
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,4 @@
using System; using System;
using System.IO;
using System.Collections.Generic; using System.Collections.Generic;
namespace YooAsset namespace YooAsset
@@ -15,12 +14,13 @@ namespace YooAsset
{ {
public string BundleGUID; public string BundleGUID;
public string FileName; public string FileName;
}
/// <summary> public FileWrapper(string bundleGUID, string fileName)
/// 文件版本 {
/// </summary> BundleGUID = bundleGUID;
public string FileVersion; FileName = fileName;
}
}
/// <summary> /// <summary>
/// 包裹名称 /// 包裹名称

View File

@@ -336,9 +336,10 @@ namespace YooAsset
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(PackageName, packageVersion); string fileName = YooAssetSettingsData.GetManifestBinaryFileName(PackageName, packageVersion);
return PathUtility.Combine(_packageRoot, fileName); return PathUtility.Combine(_packageRoot, fileName);
} }
public string GetCatalogBinaryFileLoadPath() public string GetCatalogFileLoadPath()
{ {
return PathUtility.Combine(_packageRoot, DefaultBuildinFileSystemDefine.BuildinCatalogBinaryFileName); string fileName = DefaultBuildinFileSystemDefine.BuildinCatalogFileName;
return PathUtility.Combine(YooAssetSettingsData.GetRequestYooDefaultBuildinRoot(), PackageName, fileName);
} }
/// <summary> /// <summary>

View File

@@ -5,15 +5,13 @@ using UnityEngine;
namespace YooAsset namespace YooAsset
{ {
public class DefaultBuildinFileSystemBuild : UnityEditor.Build.IPreprocessBuildWithReport public class DefaultBuildinFileSystemBuild
{ {
public int callbackOrder { get { return 0; } }
/// <summary> /// <summary>
/// 在构建应用程序前自动生成内置资源目录文件 /// 输出包裹的内置资源目录文件
/// 原理搜索StreamingAssets目录下的所有资源文件然后将这些文件信息写入文件并存储在Resources目录下。
/// </summary> /// </summary>
public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report) /// <exception cref="System.Exception"></exception>
public static void ExportBuildinCatalogFile()
{ {
YooLogger.Log("Begin to create catalog file !"); YooLogger.Log("Begin to create catalog file !");
@@ -84,24 +82,9 @@ namespace YooAsset
// 创建内置清单实例 // 创建内置清单实例
var buildinFileCatalog = new DefaultBuildinFileCatalog(); var buildinFileCatalog = new DefaultBuildinFileCatalog();
buildinFileCatalog.FileVersion = CatalogDefine.FileVersion;
buildinFileCatalog.PackageName = packageName; buildinFileCatalog.PackageName = packageName;
buildinFileCatalog.PackageVersion = packageVersion; buildinFileCatalog.PackageVersion = packageVersion;
// 创建白名单查询集合
HashSet<string> whiteFileList = new HashSet<string>
{
"link.xml",
"buildlogtep.json",
$"{packageName}.version",
$"{packageName}_{packageVersion}.bytes",
$"{packageName}_{packageVersion}.hash",
$"{packageName}_{packageVersion}.json",
$"{packageName}_{packageVersion}.report",
DefaultBuildinFileSystemDefine.BuildinCatalogJsonFileName,
DefaultBuildinFileSystemDefine.BuildinCatalogBinaryFileName
};
// 记录所有内置资源文件 // 记录所有内置资源文件
DirectoryInfo rootDirectory = new DirectoryInfo(pacakgeDirectory); DirectoryInfo rootDirectory = new DirectoryInfo(pacakgeDirectory);
FileInfo[] fileInfos = rootDirectory.GetFiles(); FileInfo[] fileInfos = rootDirectory.GetFiles();
@@ -110,15 +93,25 @@ namespace YooAsset
if (fileInfo.Extension == ".meta") if (fileInfo.Extension == ".meta")
continue; continue;
if (whiteFileList.Contains(fileInfo.Name)) if (fileInfo.Name == "link.xml" || fileInfo.Name == "buildlogtep.json")
continue;
if (fileInfo.Name == $"{packageName}.version")
continue;
if (fileInfo.Name == $"{packageName}_{packageVersion}.bytes")
continue;
if (fileInfo.Name == $"{packageName}_{packageVersion}.hash")
continue;
if (fileInfo.Name == $"{packageName}_{packageVersion}.json")
continue;
if (fileInfo.Name == $"{packageName}_{packageVersion}.report")
continue;
if (fileInfo.Name == DefaultBuildinFileSystemDefine.BuildinCatalogFileName)
continue; continue;
string fileName = fileInfo.Name; string fileName = fileInfo.Name;
if (fileMapping.TryGetValue(fileName, out string bundleGUID)) if (fileMapping.TryGetValue(fileName, out string bundleGUID))
{ {
var wrapper = new DefaultBuildinFileCatalog.FileWrapper(); var wrapper = new DefaultBuildinFileCatalog.FileWrapper(bundleGUID, fileName);
wrapper.BundleGUID = bundleGUID;
wrapper.FileName = fileName;
buildinFileCatalog.Wrappers.Add(wrapper); buildinFileCatalog.Wrappers.Add(wrapper);
} }
else else
@@ -127,20 +120,16 @@ namespace YooAsset
} }
} }
// 创建输出文件 // 创建输出目录
string jsonFilePath = $"{pacakgeDirectory}/{DefaultBuildinFileSystemDefine.BuildinCatalogJsonFileName}"; string fullPath = YooAssetSettingsData.GetYooDefaultBuildinRoot();
if (File.Exists(jsonFilePath)) string saveFilePath = $"{fullPath}/{packageName}/{DefaultBuildinFileSystemDefine.BuildinCatalogFileName}";
File.Delete(jsonFilePath); FileUtility.CreateFileDirectory(saveFilePath);
CatalogTools.SerializeToJson(jsonFilePath, buildinFileCatalog);
// 创建输出文件 // 创建输出文件
string binaryFilePath = $"{pacakgeDirectory}/{DefaultBuildinFileSystemDefine.BuildinCatalogBinaryFileName}"; File.WriteAllText(saveFilePath, JsonUtility.ToJson(buildinFileCatalog, false));
if (File.Exists(binaryFilePath))
File.Delete(binaryFilePath);
CatalogTools.SerializeToBinary(binaryFilePath, buildinFileCatalog);
UnityEditor.AssetDatabase.Refresh(); UnityEditor.AssetDatabase.Refresh();
Debug.Log($"Succeed to save buildin file catalog : {binaryFilePath}");
Debug.Log($"Succeed to save buildin file catalog : {saveFilePath}");
return true; return true;
} }
} }

View File

@@ -4,13 +4,8 @@ namespace YooAsset
internal class DefaultBuildinFileSystemDefine internal class DefaultBuildinFileSystemDefine
{ {
/// <summary> /// <summary>
/// 内置清单JSON文件名称 /// 内置清单文件名称
/// </summary> /// </summary>
public const string BuildinCatalogJsonFileName = "BuildinCatalog.json"; public const string BuildinCatalogFileName = "BuildinCatalog.json";
/// <summary>
/// 内置清单二进制文件名称
/// </summary>
public const string BuildinCatalogBinaryFileName = "BuildinCatalog.bytes";
} }
} }

View File

@@ -1,4 +1,5 @@
using System; using UnityEngine;
using UnityEngine.Networking;
namespace YooAsset namespace YooAsset
{ {
@@ -7,84 +8,89 @@ namespace YooAsset
private enum ESteps private enum ESteps
{ {
None, None,
RequestData,
LoadCatalog, LoadCatalog,
WaitForRequest,
Done, Done,
} }
private UnityWebRequest _request;
private readonly DefaultBuildinFileSystem _fileSystem; private readonly DefaultBuildinFileSystem _fileSystem;
private UnityWebDataRequestOperation _webDataRequestOp;
private ESteps _steps = ESteps.None; private ESteps _steps = ESteps.None;
internal LoadBuildinCatalogFileOperation(DefaultBuildinFileSystem fileSystem) internal LoadBuildinCatalogFileOperation(DefaultBuildinFileSystem fileSystem)
{ {
_fileSystem = fileSystem; _fileSystem = fileSystem;
} }
internal override void InternalStart() internal override void InternalStart()
{ {
_steps = ESteps.RequestData; _steps = ESteps.LoadCatalog;
} }
internal override void InternalUpdate() internal override void InternalUpdate()
{ {
if (_steps == ESteps.None || _steps == ESteps.Done) if (_steps == ESteps.None || _steps == ESteps.Done)
return; return;
if (_steps == ESteps.RequestData) string catalogFilePath = _fileSystem.GetCatalogFileLoadPath();
{
if (_webDataRequestOp == null)
{
string filePath = _fileSystem.GetCatalogBinaryFileLoadPath();
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
_webDataRequestOp = new UnityWebDataRequestOperation(url);
_webDataRequestOp.StartOperation();
AddChildOperation(_webDataRequestOp);
}
_webDataRequestOp.UpdateOperation();
if (_webDataRequestOp.IsDone == false)
return;
if (_webDataRequestOp.Status == EOperationStatus.Succeed)
{
_steps = ESteps.LoadCatalog;
}
else
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = _webDataRequestOp.Error;
}
}
if (_steps == ESteps.LoadCatalog) if (_steps == ESteps.LoadCatalog)
{ {
try _request = UnityWebRequest.Get(catalogFilePath);
{ _request.SendWebRequest();
var catalog = CatalogTools.DeserializeFromBinary(_webDataRequestOp.Result); _steps = ESteps.WaitForRequest;
if (catalog.PackageName != _fileSystem.PackageName) return;
{ }
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Catalog file package name {catalog.PackageName} cannot match the file system package name {_fileSystem.PackageName}";
return;
}
foreach (var wrapper in catalog.Wrappers) if (_steps == ESteps.WaitForRequest)
{ {
var fileWrapper = new DefaultBuildinFileSystem.FileWrapper(wrapper.FileName); // 等待请求完成
_fileSystem.RecordCatalogFile(wrapper.BundleGUID, fileWrapper); if (!_request.isDone)
} return;
YooLogger.Log($"Package '{_fileSystem.PackageName}' buildin catalog files count : {catalog.Wrappers.Count}"); if (_request.result != UnityWebRequest.Result.Success)
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
}
catch (Exception e)
{ {
_request.Dispose();
_request = null;
_steps = ESteps.Done; _steps = ESteps.Done;
Status = EOperationStatus.Failed; Status = EOperationStatus.Failed;
Error = $"Failed to load catalog file : {e.Message}"; Error = $"Failed to load catalog file: {_request.error}";
return;
} }
// 解析 JSON
string jsonText = _request.downloadHandler.text;
var catalog = JsonUtility.FromJson<DefaultBuildinFileCatalog>(jsonText);
if (catalog == null)
{
_request.Dispose();
_request = null;
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Failed to load catalog file : {catalogFilePath}";
return;
}
if (catalog.PackageName != _fileSystem.PackageName)
{
_request.Dispose();
_request = null;
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Catalog file package name {catalog.PackageName} cannot match the file system package name {_fileSystem.PackageName}";
return;
}
foreach (var wrapper in catalog.Wrappers)
{
var fileWrapper = new DefaultBuildinFileSystem.FileWrapper(wrapper.FileName);
_fileSystem.RecordCatalogFile(wrapper.BundleGUID, fileWrapper);
}
YooLogger.Log($"Package '{_fileSystem.PackageName}' buildin catalog files count : {catalog.Wrappers.Count}");
_request.Dispose();
_request = null;
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
} }
} }
} }

View File

@@ -333,13 +333,6 @@ namespace YooAsset
{ {
return _records.Keys.ToList(); return _records.Keys.ToList();
} }
public RecordFileElement GetRecordFileElement(PackageBundle bundle)
{
if (_records.TryGetValue(bundle.BundleGUID, out RecordFileElement element))
return element;
else
return null;
}
public string GetTempFilePath(PackageBundle bundle) public string GetTempFilePath(PackageBundle bundle)
{ {
@@ -391,10 +384,10 @@ namespace YooAsset
public EFileVerifyResult VerifyCacheFile(PackageBundle bundle) public EFileVerifyResult VerifyCacheFile(PackageBundle bundle)
{ {
if (_records.TryGetValue(bundle.BundleGUID, out RecordFileElement element) == false) if (_records.TryGetValue(bundle.BundleGUID, out RecordFileElement wrapper) == false)
return EFileVerifyResult.CacheNotFound; return EFileVerifyResult.CacheNotFound;
EFileVerifyResult result = FileVerifyHelper.FileVerify(element.DataFilePath, element.DataFileSize, element.DataFileCRC, EFileVerifyLevel.High); EFileVerifyResult result = FileVerifyHelper.FileVerify(wrapper.DataFilePath, wrapper.DataFileSize, wrapper.DataFileCRC, EFileVerifyLevel.High);
return result; return result;
} }
public bool WriteCacheBundleFile(PackageBundle bundle, string copyPath) public bool WriteCacheBundleFile(PackageBundle bundle, string copyPath)
@@ -434,10 +427,22 @@ namespace YooAsset
} }
public bool DeleteCacheBundleFile(string bundleGUID) public bool DeleteCacheBundleFile(string bundleGUID)
{ {
if (_records.TryGetValue(bundleGUID, out RecordFileElement element)) if (_records.TryGetValue(bundleGUID, out RecordFileElement wrapper))
{ {
_records.Remove(bundleGUID); try
return element.DeleteFolder(); {
string dataFilePath = wrapper.DataFilePath;
FileInfo fileInfo = new FileInfo(dataFilePath);
if (fileInfo.Exists)
fileInfo.Directory.Delete(true);
_records.Remove(bundleGUID);
return true;
}
catch (Exception e)
{
YooLogger.Error($"Failed to delete cache file ! {e.Message}");
return false;
}
} }
else else
{ {

View File

@@ -1,6 +1,4 @@
using System; 
using System.IO;
namespace YooAsset namespace YooAsset
{ {
internal class RecordFileElement internal class RecordFileElement
@@ -17,31 +15,5 @@ namespace YooAsset
DataFileCRC = dataFileCRC; DataFileCRC = dataFileCRC;
DataFileSize = dataFileSize; DataFileSize = dataFileSize;
} }
/// <summary>
/// 删除记录文件
/// </summary>
public bool DeleteFolder()
{
try
{
string directory = Path.GetDirectoryName(InfoFilePath);
DirectoryInfo directoryInfo = new DirectoryInfo(directory);
if (directoryInfo.Exists)
{
directoryInfo.Delete(true);
return true;
}
else
{
return false;
}
}
catch (Exception e)
{
YooLogger.Error($"Failed to delete cache file ! {e.Message}");
return false;
}
}
} }
} }

View File

@@ -1,5 +1,4 @@
using System; using System.IO;
using System.IO;
using UnityEngine; using UnityEngine;
namespace YooAsset namespace YooAsset
@@ -261,30 +260,9 @@ namespace YooAsset
{ {
if (_fileSystem.Exists(_bundle)) if (_fileSystem.Exists(_bundle))
{ {
// 注意:缓存的原生文件的格式,可能会在业务端根据需求发生变动! DownloadProgress = 1f;
// 注意:这里需要校验文件格式,如果不一致对本地文件进行修正! DownloadedBytes = _bundle.FileSize;
string filePath = _fileSystem.GetCacheBundleFileLoadPath(_bundle); _steps = ESteps.LoadCacheRawBundle;
if (File.Exists(filePath) == false)
{
try
{
var recordFileElement = _fileSystem.GetRecordFileElement(_bundle);
File.Move(recordFileElement.DataFilePath, filePath);
_steps = ESteps.LoadCacheRawBundle;
}
catch (Exception e)
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Faild rename raw data file : {e.Message}";
}
}
else
{
DownloadProgress = 1f;
DownloadedBytes = _bundle.FileSize;
_steps = ESteps.LoadCacheRawBundle;
}
} }
else else
{ {

View File

@@ -7,10 +7,9 @@ namespace YooAsset
private enum ESteps private enum ESteps
{ {
None, None,
CheckManifest,
CheckArgs, CheckArgs,
GetClearCacheFiles, GetTagsCacheFiles,
ClearFilterCacheFiles, ClearTagsCacheFiles,
Done, Done,
} }
@@ -30,27 +29,13 @@ namespace YooAsset
} }
internal override void InternalStart() internal override void InternalStart()
{ {
_steps = ESteps.CheckManifest; _steps = ESteps.CheckArgs;
} }
internal override void InternalUpdate() internal override void InternalUpdate()
{ {
if (_steps == ESteps.None || _steps == ESteps.Done) if (_steps == ESteps.None || _steps == ESteps.Done)
return; return;
if (_steps == ESteps.CheckManifest)
{
if (_manifest == null)
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = "Can not found active package manifest !";
}
else
{
_steps = ESteps.CheckArgs;
}
}
if (_steps == ESteps.CheckArgs) if (_steps == ESteps.CheckArgs)
{ {
if (_clearParam == null) if (_clearParam == null)
@@ -82,17 +67,17 @@ namespace YooAsset
return; return;
} }
_steps = ESteps.GetClearCacheFiles; _steps = ESteps.GetTagsCacheFiles;
} }
if (_steps == ESteps.GetClearCacheFiles) if (_steps == ESteps.GetTagsCacheFiles)
{ {
_clearBundleGUIDs = GetBundleGUIDsByTag(); _clearBundleGUIDs = GetTagsBundleGUIDs();
_clearFileTotalCount = _clearBundleGUIDs.Count; _clearFileTotalCount = _clearBundleGUIDs.Count;
_steps = ESteps.ClearFilterCacheFiles; _steps = ESteps.ClearTagsCacheFiles;
} }
if (_steps == ESteps.ClearFilterCacheFiles) if (_steps == ESteps.ClearTagsCacheFiles)
{ {
for (int i = _clearBundleGUIDs.Count - 1; i >= 0; i--) for (int i = _clearBundleGUIDs.Count - 1; i >= 0; i--)
{ {
@@ -115,7 +100,7 @@ namespace YooAsset
} }
} }
} }
private List<string> GetBundleGUIDsByTag() private List<string> GetTagsBundleGUIDs()
{ {
var allBundleGUIDs = _fileSystem.GetAllCachedBundleGUIDs(); var allBundleGUIDs = _fileSystem.GetAllCachedBundleGUIDs();
List<string> result = new List<string>(allBundleGUIDs.Count); List<string> result = new List<string>(allBundleGUIDs.Count);

View File

@@ -8,7 +8,6 @@ namespace YooAsset
private enum ESteps private enum ESteps
{ {
None, None,
CheckManifest,
GetUnusedCacheFiles, GetUnusedCacheFiles,
ClearUnusedCacheFiles, ClearUnusedCacheFiles,
Done, Done,
@@ -28,27 +27,13 @@ namespace YooAsset
} }
internal override void InternalStart() internal override void InternalStart()
{ {
_steps = ESteps.CheckManifest; _steps = ESteps.GetUnusedCacheFiles;
} }
internal override void InternalUpdate() internal override void InternalUpdate()
{ {
if (_steps == ESteps.None || _steps == ESteps.Done) if (_steps == ESteps.None || _steps == ESteps.Done)
return; return;
if (_steps == ESteps.CheckManifest)
{
if (_manifest == null)
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = "Can not found active package manifest !";
}
else
{
_steps = ESteps.GetUnusedCacheFiles;
}
}
if (_steps == ESteps.GetUnusedCacheFiles) if (_steps == ESteps.GetUnusedCacheFiles)
{ {
_unusedBundleGUIDs = GetUnusedBundleGUIDs(); _unusedBundleGUIDs = GetUnusedBundleGUIDs();

View File

@@ -8,7 +8,6 @@ namespace YooAsset
private enum ESteps private enum ESteps
{ {
None, None,
CheckManifest,
ClearUnusedCacheFiles, ClearUnusedCacheFiles,
Done, Done,
} }
@@ -25,27 +24,13 @@ namespace YooAsset
} }
internal override void InternalStart() internal override void InternalStart()
{ {
_steps = ESteps.CheckManifest; _steps = ESteps.ClearUnusedCacheFiles;
} }
internal override void InternalUpdate() internal override void InternalUpdate()
{ {
if (_steps == ESteps.None || _steps == ESteps.Done) if (_steps == ESteps.None || _steps == ESteps.Done)
return; return;
if (_steps == ESteps.CheckManifest)
{
if (_manifest == null)
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = "Can not found active package manifest !";
}
else
{
_steps = ESteps.ClearUnusedCacheFiles;
}
}
if (_steps == ESteps.ClearUnusedCacheFiles) if (_steps == ESteps.ClearUnusedCacheFiles)
{ {
try try

View File

@@ -92,7 +92,12 @@ namespace YooAsset
if (_fileSystem.AppendFileExtension) if (_fileSystem.AppendFileExtension)
{ {
string dataFileExtension = FindDataFileExtension(chidDirectory); string dataFileExtension = FindDataFileExtension(chidDirectory);
if (string.IsNullOrEmpty(dataFileExtension) == false) if (string.IsNullOrEmpty(dataFileExtension))
{
//注意:覆盖安装的情况下,缓存文件可能会没有后缀格式,需要删除重新下载!
dataFilePath = string.Empty;
}
else
{ {
dataFilePath += dataFileExtension; dataFilePath += dataFileExtension;
} }

View File

@@ -198,9 +198,10 @@ namespace YooAsset
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(PackageName, packageVersion); string fileName = YooAssetSettingsData.GetManifestBinaryFileName(PackageName, packageVersion);
return PathUtility.Combine(FileRoot, fileName); return PathUtility.Combine(FileRoot, fileName);
} }
public string GetCatalogBinaryFileLoadPath() public string GetCatalogFileLoadPath()
{ {
return PathUtility.Combine(_webPackageRoot, DefaultBuildinFileSystemDefine.BuildinCatalogBinaryFileName); string fileName = Path.GetFileNameWithoutExtension(DefaultBuildinFileSystemDefine.BuildinCatalogFileName);
return YooAssetSettingsData.GetYooResourcesLoadPath(PackageName, fileName);
} }
/// <summary> /// <summary>

View File

@@ -2,6 +2,8 @@
using System.IO; using System.IO;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
namespace YooAsset namespace YooAsset
{ {
@@ -10,84 +12,94 @@ namespace YooAsset
private enum ESteps private enum ESteps
{ {
None, None,
RequestData,
LoadCatalog, LoadCatalog,
WaitForRequest,
Done, Done,
} }
private UnityWebRequest _request;
private readonly DefaultWebServerFileSystem _fileSystem; private readonly DefaultWebServerFileSystem _fileSystem;
private UnityWebDataRequestOperation _webDataRequestOp;
private ESteps _steps = ESteps.None; private ESteps _steps = ESteps.None;
/// <summary>
/// 内置清单版本
/// </summary>
public string PackageVersion { private set; get; }
internal LoadWebServerCatalogFileOperation(DefaultWebServerFileSystem fileSystem) internal LoadWebServerCatalogFileOperation(DefaultWebServerFileSystem fileSystem)
{ {
_fileSystem = fileSystem; _fileSystem = fileSystem;
} }
internal override void InternalStart() internal override void InternalStart()
{ {
_steps = ESteps.RequestData; _steps = ESteps.LoadCatalog;
} }
internal override void InternalUpdate() internal override void InternalUpdate()
{ {
if (_steps == ESteps.None || _steps == ESteps.Done) if (_steps == ESteps.None || _steps == ESteps.Done)
return; return;
if (_steps == ESteps.RequestData) string catalogFilePath = _fileSystem.GetCatalogFileLoadPath();
{
if (_webDataRequestOp == null)
{
string filePath = _fileSystem.GetCatalogBinaryFileLoadPath();
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
_webDataRequestOp = new UnityWebDataRequestOperation(url);
_webDataRequestOp.StartOperation();
AddChildOperation(_webDataRequestOp);
}
_webDataRequestOp.UpdateOperation();
if (_webDataRequestOp.IsDone == false)
return;
if (_webDataRequestOp.Status == EOperationStatus.Succeed)
{
_steps = ESteps.LoadCatalog;
}
else
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = _webDataRequestOp.Error;
}
}
if (_steps == ESteps.LoadCatalog) if (_steps == ESteps.LoadCatalog)
{ {
try _request = UnityWebRequest.Get(catalogFilePath);
{ _request.SendWebRequest();
var catalog = CatalogTools.DeserializeFromBinary(_webDataRequestOp.Result); _steps = ESteps.WaitForRequest;
if (catalog.PackageName != _fileSystem.PackageName) return;
{ }
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Catalog file package name {catalog.PackageName} cannot match the file system package name {_fileSystem.PackageName}";
return;
}
foreach (var wrapper in catalog.Wrappers) if (_steps == ESteps.WaitForRequest)
{ {
var fileWrapper = new DefaultWebServerFileSystem.FileWrapper(wrapper.FileName); // 等待请求完成
_fileSystem.RecordCatalogFile(wrapper.BundleGUID, fileWrapper); if (!_request.isDone)
} return;
YooLogger.Log($"Package '{_fileSystem.PackageName}' buildin catalog files count : {catalog.Wrappers.Count}"); if (_request.result != UnityWebRequest.Result.Success)
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
}
catch (Exception e)
{ {
_request.Dispose();
_request = null;
_steps = ESteps.Done; _steps = ESteps.Done;
Status = EOperationStatus.Failed; Status = EOperationStatus.Failed;
Error = $"Failed to load catalog file : {e.Message}"; Error = $"Failed to load web server catalog file: {_request.error}";
return;
} }
// 解析 JSON
string jsonText = _request.downloadHandler.text;
var catalog = JsonUtility.FromJson<DefaultBuildinFileCatalog>(jsonText);
if (catalog == null)
{
_request.Dispose();
_request = null;
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Failed to load web server catalog file : {catalogFilePath}";
return;
}
if (catalog.PackageName != _fileSystem.PackageName)
{
_request.Dispose();
_request = null;
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Web server catalog file package name {catalog.PackageName} cannot match the file system package name {_fileSystem.PackageName}";
return;
}
PackageVersion = catalog.PackageVersion;
foreach (var wrapper in catalog.Wrappers)
{
var fileWrapper = new DefaultWebServerFileSystem.FileWrapper(wrapper.FileName);
_fileSystem.RecordCatalogFile(wrapper.BundleGUID, fileWrapper);
}
YooLogger.Log($"Package '{_fileSystem.PackageName}' catalog files count : {catalog.Wrappers.Count}");
_request.Dispose();
_request = null;
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
} }
} }
} }

View File

@@ -1,21 +0,0 @@

namespace YooAsset
{
public class ManifestDefine
{
/// <summary>
/// 文件极限大小100MB
/// </summary>
public const int FileMaxSize = 104857600;
/// <summary>
/// 文件头标记
/// </summary>
public const uint FileSign = 0x594F4F;
/// <summary>
/// 文件格式版本
/// </summary>
public const string FileVersion = "2.3.1";
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 3282b72521a19144292a482e50ba0429
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -8,6 +8,7 @@ namespace YooAsset
{ {
internal static class ManifestTools internal static class ManifestTools
{ {
#if UNITY_EDITOR
/// <summary> /// <summary>
/// 序列化JSON文件 /// 序列化JSON文件
/// </summary> /// </summary>
@@ -25,10 +26,10 @@ namespace YooAsset
using (FileStream fs = new FileStream(savePath, FileMode.Create)) using (FileStream fs = new FileStream(savePath, FileMode.Create))
{ {
// 创建缓存器 // 创建缓存器
BufferWriter buffer = new BufferWriter(ManifestDefine.FileMaxSize); BufferWriter buffer = new BufferWriter(YooAssetSettings.ManifestFileMaxSize);
// 写入文件标记 // 写入文件标记
buffer.WriteUInt32(ManifestDefine.FileSign); buffer.WriteUInt32(YooAssetSettings.ManifestFileSign);
// 写入文件版本 // 写入文件版本
buffer.WriteUTF8(manifest.FileVersion); buffer.WriteUTF8(manifest.FileVersion);
@@ -96,13 +97,13 @@ namespace YooAsset
// 读取文件标记 // 读取文件标记
uint fileSign = buffer.ReadUInt32(); uint fileSign = buffer.ReadUInt32();
if (fileSign != ManifestDefine.FileSign) if (fileSign != YooAssetSettings.ManifestFileSign)
throw new Exception("Invalid manifest file !"); throw new Exception("Invalid manifest file !");
// 读取文件版本 // 读取文件版本
string fileVersion = buffer.ReadUTF8(); string fileVersion = buffer.ReadUTF8();
if (fileVersion != ManifestDefine.FileVersion) if (fileVersion != YooAssetSettings.ManifestFileVersion)
throw new Exception($"The manifest file version are not compatible : {fileVersion} != {ManifestDefine.FileVersion}"); throw new Exception($"The manifest file version are not compatible : {fileVersion} != {YooAssetSettings.ManifestFileVersion}");
PackageManifest manifest = new PackageManifest(); PackageManifest manifest = new PackageManifest();
{ {
@@ -159,7 +160,7 @@ namespace YooAsset
InitManifest(manifest); InitManifest(manifest);
return manifest; return manifest;
} }
#endif
#region #region
public static void InitManifest(PackageManifest manifest) public static void InitManifest(PackageManifest manifest)

View File

@@ -57,7 +57,7 @@ namespace YooAsset
// 读取文件标记 // 读取文件标记
uint fileSign = _buffer.ReadUInt32(); uint fileSign = _buffer.ReadUInt32();
if (fileSign != ManifestDefine.FileSign) if (fileSign != YooAssetSettings.ManifestFileSign)
{ {
_steps = ESteps.Done; _steps = ESteps.Done;
Status = EOperationStatus.Failed; Status = EOperationStatus.Failed;
@@ -67,11 +67,11 @@ namespace YooAsset
// 读取文件版本 // 读取文件版本
string fileVersion = _buffer.ReadUTF8(); string fileVersion = _buffer.ReadUTF8();
if (fileVersion != ManifestDefine.FileVersion) if (fileVersion != YooAssetSettings.ManifestFileVersion)
{ {
_steps = ESteps.Done; _steps = ESteps.Done;
Status = EOperationStatus.Failed; Status = EOperationStatus.Failed;
Error = $"The manifest file version are not compatible : {fileVersion} != {ManifestDefine.FileVersion}"; Error = $"The manifest file version are not compatible : {fileVersion} != {YooAssetSettings.ManifestFileVersion}";
return; return;
} }

View File

@@ -263,7 +263,7 @@ namespace YooAsset
/// <param name="clearParam">执行参数</param> /// <param name="clearParam">执行参数</param>
public ClearCacheFilesOperation ClearCacheFilesAsync(EFileClearMode clearMode, object clearParam = null) public ClearCacheFilesOperation ClearCacheFilesAsync(EFileClearMode clearMode, object clearParam = null)
{ {
DebugCheckInitialize(false); DebugCheckInitialize();
var operation = _playModeImpl.ClearCacheFilesAsync(clearMode.ToString(), clearParam); var operation = _playModeImpl.ClearCacheFilesAsync(clearMode.ToString(), clearParam);
OperationSystem.StartOperation(PackageName, operation); OperationSystem.StartOperation(PackageName, operation);
return operation; return operation;
@@ -276,7 +276,7 @@ namespace YooAsset
/// <param name="clearParam">执行参数</param> /// <param name="clearParam">执行参数</param>
public ClearCacheFilesOperation ClearCacheFilesAsync(string clearMode, object clearParam = null) public ClearCacheFilesOperation ClearCacheFilesAsync(string clearMode, object clearParam = null)
{ {
DebugCheckInitialize(false); DebugCheckInitialize();
var operation = _playModeImpl.ClearCacheFilesAsync(clearMode, clearParam); var operation = _playModeImpl.ClearCacheFilesAsync(clearMode, clearParam);
OperationSystem.StartOperation(PackageName, operation); OperationSystem.StartOperation(PackageName, operation);
return operation; return operation;

View File

@@ -16,6 +16,22 @@ namespace YooAsset
public string PackageManifestPrefix = string.Empty; public string PackageManifestPrefix = string.Empty;
/// <summary>
/// 清单文件头标记
/// </summary>
public const uint ManifestFileSign = 0x594F4F;
/// <summary>
/// 清单文件极限大小100MB
/// </summary>
public const int ManifestFileMaxSize = 104857600;
/// <summary>
/// 清单文件格式版本
/// </summary>
public const string ManifestFileVersion = "2.3.1";
/// <summary> /// <summary>
/// 构建输出文件夹名称 /// 构建输出文件夹名称
/// </summary> /// </summary>

View File

@@ -106,6 +106,28 @@ namespace YooAsset
} }
#region #region
/// <summary>
/// 获取YOO的Resources目录的加载路径
/// </summary>
internal static string GetYooResourcesLoadPath(string packageName, string fileName)
{
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
return PathUtility.Combine(packageName, fileName);
else
return PathUtility.Combine(Setting.DefaultYooFolderName, packageName, fileName);
}
/// <summary>
/// 获取YOO的Resources目录的全路径
/// </summary>
internal static string GetYooResourcesFullPath()
{
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
return $"Assets/Resources";
else
return $"Assets/Resources/{Setting.DefaultYooFolderName}";
}
/// <summary> /// <summary>
/// 获取YOO的编辑器下缓存文件根目录 /// 获取YOO的编辑器下缓存文件根目录
/// </summary> /// </summary>
@@ -198,6 +220,26 @@ namespace YooAsset
else else
return PathUtility.Combine(Application.streamingAssetsPath, Setting.DefaultYooFolderName); return PathUtility.Combine(Application.streamingAssetsPath, Setting.DefaultYooFolderName);
} }
internal static string GetRequestYooDefaultBuildinRoot()
{
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
return GetRequestStreamingAssetsPath();
else
return PathUtility.Combine(GetRequestStreamingAssetsPath(), Setting.DefaultYooFolderName);
}
/// <summary>
/// 获取UnityWebRequest StreamingAssets的路径 (OSX and iOS 需要加 file://)
/// </summary>
internal static string GetRequestStreamingAssetsPath()
{
#if UNITY_STANDALONE_OSX || UNITY_IOS
return $"file://{Application.streamingAssetsPath}";
#else
return Application.streamingAssetsPath;
#endif
}
#endregion #endregion
} }
} }

View File

@@ -17,7 +17,7 @@ internal class WXFSClearUnusedBundleFilesAsync : FSClearCacheFilesOperation
private readonly WechatFileSystem _fileSystem; private readonly WechatFileSystem _fileSystem;
private readonly PackageManifest _manifest; private readonly PackageManifest _manifest;
private List<string> _unusedCacheFiles = new List<string>(1000); private List<string> _unusedCacheFiles;
private int _unusedFileTotalCount = 0; private int _unusedFileTotalCount = 0;
private ESteps _steps = ESteps.None; private ESteps _steps = ESteps.None;

View File

@@ -1,7 +1,7 @@
{ {
"name": "com.tuyoogame.yooasset", "name": "com.tuyoogame.yooasset",
"displayName": "YooAsset", "displayName": "YooAsset",
"version": "2.3.6", "version": "2.3.4-preview",
"unity": "2019.4", "unity": "2019.4",
"description": "unity3d resources management system.", "description": "unity3d resources management system.",
"author": { "author": {