mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-30 13:38:46 +00:00
@@ -181,7 +181,7 @@ namespace YooAsset
|
||||
PackageName = packageName;
|
||||
|
||||
if (string.IsNullOrEmpty(rootDirectory))
|
||||
rootDirectory = GetDefaultRoot();
|
||||
rootDirectory = GetDefaultBuildinRoot();
|
||||
|
||||
_packageRoot = PathUtility.Combine(rootDirectory, packageName);
|
||||
|
||||
@@ -292,9 +292,9 @@ namespace YooAsset
|
||||
}
|
||||
|
||||
#region 内部方法
|
||||
protected string GetDefaultRoot()
|
||||
protected string GetDefaultBuildinRoot()
|
||||
{
|
||||
return PathUtility.Combine(Application.streamingAssetsPath, YooAssetSettingsData.Setting.DefaultYooFolderName);
|
||||
return YooAssetSettingsData.GetYooMobileBuildinRoot();
|
||||
}
|
||||
public string GetBuildinFileLoadPath(PackageBundle bundle)
|
||||
{
|
||||
@@ -305,30 +305,25 @@ namespace YooAsset
|
||||
}
|
||||
return filePath;
|
||||
}
|
||||
public string GetBuildinCatalogFileLoadPath()
|
||||
{
|
||||
string fileName = Path.GetFileNameWithoutExtension(DefaultBuildinFileSystemDefine.BuildinCatalogFileName);
|
||||
return PathUtility.Combine(YooAssetSettingsData.Setting.DefaultYooFolderName, PackageName, fileName);
|
||||
}
|
||||
public string GetBuildinPackageVersionFilePath()
|
||||
{
|
||||
string fileName = YooAssetSettingsData.GetPackageVersionFileName(PackageName);
|
||||
return PathUtility.Combine(FileRoot, fileName);
|
||||
return PathUtility.Combine(_packageRoot, fileName);
|
||||
}
|
||||
public string GetBuildinPackageHashFilePath(string packageVersion)
|
||||
{
|
||||
string fileName = YooAssetSettingsData.GetPackageHashFileName(PackageName, packageVersion);
|
||||
return PathUtility.Combine(FileRoot, fileName);
|
||||
return PathUtility.Combine(_packageRoot, fileName);
|
||||
}
|
||||
public string GetBuildinPackageManifestFilePath(string packageVersion)
|
||||
{
|
||||
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(PackageName, packageVersion);
|
||||
return PathUtility.Combine(FileRoot, fileName);
|
||||
return PathUtility.Combine(_packageRoot, fileName);
|
||||
}
|
||||
public string GetStreamingAssetsPackageRoot()
|
||||
public string GetCatalogFileLoadPath()
|
||||
{
|
||||
string rootPath = PathUtility.Combine(Application.dataPath, "StreamingAssets", YooAssetSettingsData.Setting.DefaultYooFolderName);
|
||||
return PathUtility.Combine(rootPath, PackageName);
|
||||
string fileName = Path.GetFileNameWithoutExtension(DefaultBuildinFileSystemDefine.BuildinCatalogFileName);
|
||||
return YooAssetSettingsData.GetYooResourcesLoadPath(PackageName, fileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -17,12 +17,12 @@ namespace YooAsset
|
||||
{
|
||||
YooLogger.Log("Begin to create catalog file !");
|
||||
|
||||
string savePath = $"Assets/Resources/{YooAssetSettingsData.Setting.DefaultYooFolderName}";
|
||||
string savePath = YooAssetSettingsData.GetYooResourcesFullPath();
|
||||
DirectoryInfo saveDirectory = new DirectoryInfo(savePath);
|
||||
if (saveDirectory.Exists)
|
||||
saveDirectory.Delete(true);
|
||||
|
||||
string rootPath = $"{Application.dataPath}/StreamingAssets/{YooAssetSettingsData.Setting.DefaultYooFolderName}";
|
||||
string rootPath = YooAssetSettingsData.GetYooEditorBuildinRoot();
|
||||
DirectoryInfo rootDirectory = new DirectoryInfo(rootPath);
|
||||
if (rootDirectory.Exists == false)
|
||||
{
|
||||
@@ -105,7 +105,8 @@ namespace YooAsset
|
||||
}
|
||||
}
|
||||
|
||||
string saveFilePath = $"Assets/Resources/{YooAssetSettingsData.Setting.DefaultYooFolderName}/{packageName}/{DefaultBuildinFileSystemDefine.BuildinCatalogFileName}";
|
||||
string fullPath = YooAssetSettingsData.GetYooResourcesFullPath();
|
||||
string saveFilePath = $"{fullPath}/{packageName}/{DefaultBuildinFileSystemDefine.BuildinCatalogFileName}";
|
||||
FileUtility.CreateFileDirectory(saveFilePath);
|
||||
|
||||
UnityEditor.AssetDatabase.CreateAsset(buildinFileCatalog, saveFilePath);
|
||||
|
||||
@@ -65,7 +65,8 @@ namespace YooAsset
|
||||
#if UNITY_EDITOR
|
||||
// 兼容性初始化
|
||||
// 说明:内置文件系统在编辑器下运行时需要动态生成
|
||||
string packageRoot = _fileSystem.GetStreamingAssetsPackageRoot();
|
||||
string buildinRoot = YooAssetSettingsData.GetYooEditorBuildinRoot();
|
||||
string packageRoot = PathUtility.Combine(buildinRoot, _fileSystem.PackageName);
|
||||
DefaultBuildinFileSystemBuild.CreateBuildinCatalogFile(_fileSystem.PackageName, packageRoot);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace YooAsset
|
||||
|
||||
if (_steps == ESteps.LoadCatalog)
|
||||
{
|
||||
string catalogFilePath = _fileSystem.GetBuildinCatalogFileLoadPath();
|
||||
string catalogFilePath = _fileSystem.GetCatalogFileLoadPath();
|
||||
var catalog = Resources.Load<DefaultBuildinFileCatalog>(catalogFilePath);
|
||||
if (catalog == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user