update file system

统一所有PlayMode的初始化行为
This commit is contained in:
何冠峰
2024-07-09 23:37:20 +08:00
parent 24c5108ce1
commit 589eea7cf3
16 changed files with 189 additions and 238 deletions
@@ -201,6 +201,11 @@ namespace YooAsset
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(PackageName, packageVersion);
return PathUtility.Combine(FileRoot, fileName);
}
public string GetStreamingAssetsPackageRoot()
{
string rootPath = PathUtility.Combine(Application.dataPath, "StreamingAssets", YooAssetSettingsData.Setting.DefaultYooFolderName);
return PathUtility.Combine(rootPath, PackageName);
}
/// <summary>
/// 记录文件信息
@@ -32,6 +32,13 @@ namespace YooAsset
{
if (_loadCatalogFileOp == null)
{
#if UNITY_EDITOR
// 兼容性初始化
// 说明:内置文件系统在编辑器下运行时需要动态生成
string packageRoot = _fileSystem.GetStreamingAssetsPackageRoot();
DefaultBuildinFileSystemBuild.CreateBuildinCatalogFile(_fileSystem.PackageName, packageRoot);
#endif
_loadCatalogFileOp = new LoadWebCatalogFileOperation(_fileSystem);
OperationSystem.StartOperation(_fileSystem.PackageName, _loadCatalogFileOp);
}