mirror of https://github.com/tuyoogame/YooAsset
update YooAssetSettings
parent
38471cdd6c
commit
20c07af504
|
@ -22,7 +22,7 @@ namespace YooAsset.Editor
|
|||
/// </summary>
|
||||
public static string GetStreamingAssetsRoot()
|
||||
{
|
||||
return YooAssetSettingsData.GetYooEditorBuildinRoot();
|
||||
return YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -68,6 +68,17 @@ namespace YooAsset
|
|||
/// </summary>
|
||||
public bool DisableCatalogFile { private set; get; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 自定义参数:拷贝内置清单
|
||||
/// </summary>
|
||||
public bool CopyBuildinPackageManifest { private set; get; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 自定义参数:拷贝内置清单的目标目录
|
||||
/// 注意:该参数为空的时候,会获取默认的沙盒目录!
|
||||
/// </summary>
|
||||
public string CopyBuildinPackageManifestDestPath { private set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义参数:解密方法类
|
||||
/// </summary>
|
||||
|
@ -147,6 +158,11 @@ namespace YooAsset
|
|||
{
|
||||
DisableCatalogFile = (bool)value;
|
||||
}
|
||||
else if (name == FileSystemParametersDefine.COPY_BUILDIN_PACKAGE_MANIFEST)
|
||||
{
|
||||
CopyBuildinPackageManifest = true;
|
||||
CopyBuildinPackageManifestDestPath = (string)value;
|
||||
}
|
||||
else if (name == FileSystemParametersDefine.DECRYPTION_SERVICES)
|
||||
{
|
||||
DecryptionServices = (IDecryptionServices)value;
|
||||
|
@ -291,7 +307,7 @@ namespace YooAsset
|
|||
#region 内部方法
|
||||
protected string GetDefaultBuildinPackageRoot(string packageName)
|
||||
{
|
||||
string rootDirectory = YooAssetSettingsData.GetYooMobileBuildinRoot();
|
||||
string rootDirectory = YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
||||
return PathUtility.Combine(rootDirectory, packageName);
|
||||
}
|
||||
public string GetBuildinFileLoadPath(PackageBundle bundle)
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace YooAsset
|
|||
if (saveDirectory.Exists)
|
||||
saveDirectory.Delete(true);
|
||||
|
||||
string rootPath = YooAssetSettingsData.GetYooEditorBuildinRoot();
|
||||
string rootPath = YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
||||
DirectoryInfo rootDirectory = new DirectoryInfo(rootPath);
|
||||
if (rootDirectory.Exists == false)
|
||||
{
|
||||
|
|
|
@ -473,16 +473,7 @@ namespace YooAsset
|
|||
#region 内部方法
|
||||
public string GetDefaultCachePackageRoot(string packageName)
|
||||
{
|
||||
string rootDirectory;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
rootDirectory = YooAssetSettingsData.GetYooEditorCacheRoot();
|
||||
#elif UNITY_STANDALONE
|
||||
rootDirectory = YooAssetSettingsData.GetYooStandaloneCacheRoot();
|
||||
#else
|
||||
rootDirectory = YooAssetSettingsData.GetYooMobileCacheRoot();
|
||||
#endif
|
||||
|
||||
string rootDirectory = YooAssetSettingsData.GetYooDefaultCacheRoot();
|
||||
return PathUtility.Combine(rootDirectory, packageName);
|
||||
}
|
||||
public string GetCacheBundleFileLoadPath(PackageBundle bundle)
|
||||
|
|
|
@ -174,17 +174,17 @@ namespace YooAsset
|
|||
public string GetEditorPackageVersionFilePath()
|
||||
{
|
||||
string fileName = YooAssetSettingsData.GetPackageVersionFileName(PackageName);
|
||||
return PathUtility.Combine(FileRoot, fileName);
|
||||
return PathUtility.Combine(_packageRoot, fileName);
|
||||
}
|
||||
public string GetEditorPackageHashFilePath(string packageVersion)
|
||||
{
|
||||
string fileName = YooAssetSettingsData.GetPackageHashFileName(PackageName, packageVersion);
|
||||
return PathUtility.Combine(FileRoot, fileName);
|
||||
return PathUtility.Combine(_packageRoot, fileName);
|
||||
}
|
||||
public string GetEditorPackageManifestFilePath(string packageVersion)
|
||||
{
|
||||
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(PackageName, packageVersion);
|
||||
return PathUtility.Combine(FileRoot, fileName);
|
||||
return PathUtility.Combine(_packageRoot, fileName);
|
||||
}
|
||||
public int GetAsyncSimulateFrame()
|
||||
{
|
||||
|
|
|
@ -168,7 +168,7 @@ namespace YooAsset
|
|||
#region 内部方法
|
||||
protected string GetDefaultWebPackageRoot(string packageName)
|
||||
{
|
||||
string rootDirectory = YooAssetSettingsData.GetYooWebBuildinRoot();
|
||||
string rootDirectory = YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
||||
return PathUtility.Combine(rootDirectory, packageName);
|
||||
}
|
||||
public string GetWebFileLoadPath(PackageBundle bundle)
|
||||
|
|
|
@ -37,8 +37,7 @@ namespace YooAsset
|
|||
#if UNITY_EDITOR
|
||||
// 兼容性初始化
|
||||
// 说明:内置文件系统在编辑器下运行时需要动态生成
|
||||
string buildinRoot = YooAssetSettingsData.GetYooEditorBuildinRoot();
|
||||
string packageRoot = PathUtility.Combine(buildinRoot, _fileSystem.PackageName);
|
||||
string packageRoot = _fileSystem.FileRoot;
|
||||
bool result = DefaultBuildinFileSystemBuild.CreateBuildinCatalogFile(_fileSystem.PackageName, packageRoot);
|
||||
if (result == false)
|
||||
{
|
||||
|
|
|
@ -15,5 +15,6 @@ namespace YooAsset
|
|||
public const string RESUME_DOWNLOAD_RESPONSE_CODES = "RESUME_DOWNLOAD_RESPONSE_CODES";
|
||||
public const string ASYNC_SIMULATE_MIN_FRAME = "ASYNC_SIMULATE_MIN_FRAME";
|
||||
public const string ASYNC_SIMULATE_MAX_FRAME = "ASYNC_SIMULATE_MAX_FRAME";
|
||||
public const string COPY_BUILDIN_PACKAGE_MANIFEST = "COPY_BUILDIN_PACKAGE_MANIFEST";
|
||||
}
|
||||
}
|
|
@ -111,50 +111,6 @@ namespace YooAsset
|
|||
return $"Assets/Resources/{Setting.DefaultYooFolderName}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取YOO的编辑器下内置文件根目录
|
||||
/// </summary>
|
||||
public static string GetYooEditorBuildinRoot()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||
return PathUtility.Combine(Application.dataPath, "StreamingAssets");
|
||||
else
|
||||
return PathUtility.Combine(Application.dataPath, "StreamingAssets", Setting.DefaultYooFolderName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取YOO的PC端内置文件根目录
|
||||
/// </summary>
|
||||
public static string GetYooStandaloneBuildinRoot()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||
return Application.streamingAssetsPath;
|
||||
else
|
||||
return PathUtility.Combine(Application.streamingAssetsPath, Setting.DefaultYooFolderName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取YOO的移动端内置文件根目录
|
||||
/// </summary>
|
||||
public static string GetYooMobileBuildinRoot()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||
return Application.streamingAssetsPath;
|
||||
else
|
||||
return PathUtility.Combine(Application.streamingAssetsPath, Setting.DefaultYooFolderName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取YOO的Web端内置文件根目录
|
||||
/// </summary>
|
||||
public static string GetYooWebBuildinRoot()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||
return Application.streamingAssetsPath;
|
||||
else
|
||||
return PathUtility.Combine(Application.streamingAssetsPath, Setting.DefaultYooFolderName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取YOO的编辑器下缓存文件根目录
|
||||
/// </summary>
|
||||
|
@ -196,6 +152,31 @@ namespace YooAsset
|
|||
else
|
||||
return PathUtility.Combine(Application.persistentDataPath, Setting.DefaultYooFolderName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取YOO默认的缓存文件根目录
|
||||
/// </summary>
|
||||
public static string GetYooDefaultCacheRoot()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return GetYooEditorCacheRoot();
|
||||
#elif UNITY_STANDALONE
|
||||
return GetYooStandaloneCacheRoot();
|
||||
#else
|
||||
return GetYooMobileCacheRoot();
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取YOO默认的内置文件根目录
|
||||
/// </summary>
|
||||
public static string GetYooDefaultBuildinRoot()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Setting.DefaultYooFolderName))
|
||||
return Application.streamingAssetsPath;
|
||||
else
|
||||
return PathUtility.Combine(Application.streamingAssetsPath, Setting.DefaultYooFolderName);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue