mirror of https://github.com/tuyoogame/YooAsset
Compare commits
No commits in common. "e925d9892f98ec34890700709bf0217c465a129b" and "38471cdd6cebd6777d4700061951f0365afaa69e" have entirely different histories.
e925d9892f
...
38471cdd6c
|
@ -36,7 +36,7 @@ namespace YooAsset.Editor
|
||||||
BuildLogger.InitLogger(enableLog);
|
BuildLogger.InitLogger(enableLog);
|
||||||
|
|
||||||
// 执行构建流程
|
// 执行构建流程
|
||||||
BuildLogger.Log($"Begin to build package : {buildParameters.PackageName} by {buildParameters.BuildPipeline}");
|
Debug.Log($"Begin to build package : {buildParameters.PackageName} by {buildParameters.BuildPipeline}");
|
||||||
var buildResult = BuildRunner.Run(buildPipeline, _buildContext);
|
var buildResult = BuildRunner.Run(buildPipeline, _buildContext);
|
||||||
if (buildResult.Success)
|
if (buildResult.Success)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace YooAsset.Editor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GetStreamingAssetsRoot()
|
public static string GetStreamingAssetsRoot()
|
||||||
{
|
{
|
||||||
return YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
return YooAssetSettingsData.GetYooEditorBuildinRoot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -68,17 +68,6 @@ namespace YooAsset
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool DisableCatalogFile { private set; get; } = false;
|
public bool DisableCatalogFile { private set; get; } = false;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 自定义参数:拷贝内置清单
|
|
||||||
/// </summary>
|
|
||||||
public bool CopyBuildinPackageManifest { private set; get; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 自定义参数:拷贝内置清单的目标目录
|
|
||||||
/// 注意:该参数为空的时候,会获取默认的沙盒目录!
|
|
||||||
/// </summary>
|
|
||||||
public string CopyBuildinPackageManifestDestRoot { private set; get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义参数:解密方法类
|
/// 自定义参数:解密方法类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -158,14 +147,6 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
DisableCatalogFile = (bool)value;
|
DisableCatalogFile = (bool)value;
|
||||||
}
|
}
|
||||||
else if (name == FileSystemParametersDefine.COPY_BUILDIN_PACKAGE_MANIFEST)
|
|
||||||
{
|
|
||||||
CopyBuildinPackageManifest = (bool)value;
|
|
||||||
}
|
|
||||||
else if (name == FileSystemParametersDefine.COPY_BUILDIN_PACKAGE_MANIFEST_DEST_ROOT)
|
|
||||||
{
|
|
||||||
CopyBuildinPackageManifestDestRoot = (string)value;
|
|
||||||
}
|
|
||||||
else if (name == FileSystemParametersDefine.DECRYPTION_SERVICES)
|
else if (name == FileSystemParametersDefine.DECRYPTION_SERVICES)
|
||||||
{
|
{
|
||||||
DecryptionServices = (IDecryptionServices)value;
|
DecryptionServices = (IDecryptionServices)value;
|
||||||
|
@ -310,7 +291,7 @@ namespace YooAsset
|
||||||
#region 内部方法
|
#region 内部方法
|
||||||
protected string GetDefaultBuildinPackageRoot(string packageName)
|
protected string GetDefaultBuildinPackageRoot(string packageName)
|
||||||
{
|
{
|
||||||
string rootDirectory = YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
string rootDirectory = YooAssetSettingsData.GetYooMobileBuildinRoot();
|
||||||
return PathUtility.Combine(rootDirectory, packageName);
|
return PathUtility.Combine(rootDirectory, packageName);
|
||||||
}
|
}
|
||||||
public string GetBuildinFileLoadPath(PackageBundle bundle)
|
public string GetBuildinFileLoadPath(PackageBundle bundle)
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace YooAsset
|
||||||
if (saveDirectory.Exists)
|
if (saveDirectory.Exists)
|
||||||
saveDirectory.Delete(true);
|
saveDirectory.Delete(true);
|
||||||
|
|
||||||
string rootPath = YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
string rootPath = YooAssetSettingsData.GetYooEditorBuildinRoot();
|
||||||
DirectoryInfo rootDirectory = new DirectoryInfo(rootPath);
|
DirectoryInfo rootDirectory = new DirectoryInfo(rootPath);
|
||||||
if (rootDirectory.Exists == false)
|
if (rootDirectory.Exists == false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,14 +8,12 @@ namespace YooAsset
|
||||||
private enum ESteps
|
private enum ESteps
|
||||||
{
|
{
|
||||||
None,
|
None,
|
||||||
CopyBuildinManifest,
|
|
||||||
InitUnpackFileSystem,
|
InitUnpackFileSystem,
|
||||||
LoadCatalogFile,
|
LoadCatalogFile,
|
||||||
Done,
|
Done,
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly DefaultBuildinFileSystem _fileSystem;
|
private readonly DefaultBuildinFileSystem _fileSystem;
|
||||||
private CopyBuildinPackageManifestOperation _copyBuildinPackageManifestOp;
|
|
||||||
private FSInitializeFileSystemOperation _initUnpackFIleSystemOp;
|
private FSInitializeFileSystemOperation _initUnpackFIleSystemOp;
|
||||||
private LoadBuildinCatalogFileOperation _loadCatalogFileOp;
|
private LoadBuildinCatalogFileOperation _loadCatalogFileOp;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
@ -31,9 +29,6 @@ namespace YooAsset
|
||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
Error = $"{nameof(DefaultBuildinFileSystem)} is not support WEBGL platform !";
|
Error = $"{nameof(DefaultBuildinFileSystem)} is not support WEBGL platform !";
|
||||||
#else
|
#else
|
||||||
if (_fileSystem.CopyBuildinPackageManifest)
|
|
||||||
_steps = ESteps.CopyBuildinManifest;
|
|
||||||
else
|
|
||||||
_steps = ESteps.InitUnpackFileSystem;
|
_steps = ESteps.InitUnpackFileSystem;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -42,29 +37,6 @@ namespace YooAsset
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_steps == ESteps.CopyBuildinManifest)
|
|
||||||
{
|
|
||||||
if (_copyBuildinPackageManifestOp == null)
|
|
||||||
{
|
|
||||||
_copyBuildinPackageManifestOp = new CopyBuildinPackageManifestOperation(_fileSystem);
|
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _copyBuildinPackageManifestOp);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_copyBuildinPackageManifestOp.IsDone == false)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_copyBuildinPackageManifestOp.Status == EOperationStatus.Succeed)
|
|
||||||
{
|
|
||||||
_steps = ESteps.InitUnpackFileSystem;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_steps = ESteps.Done;
|
|
||||||
Status = EOperationStatus.Failed;
|
|
||||||
Error = _copyBuildinPackageManifestOp.Error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_steps == ESteps.InitUnpackFileSystem)
|
if (_steps == ESteps.InitUnpackFileSystem)
|
||||||
{
|
{
|
||||||
if (_initUnpackFIleSystemOp == null)
|
if (_initUnpackFIleSystemOp == null)
|
||||||
|
|
|
@ -1,167 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace YooAsset
|
|
||||||
{
|
|
||||||
internal class CopyBuildinPackageManifestOperation : AsyncOperationBase
|
|
||||||
{
|
|
||||||
private enum ESteps
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
RequestPackageVersion,
|
|
||||||
CheckHashFile,
|
|
||||||
UnpackHashFile,
|
|
||||||
CheckManifestFile,
|
|
||||||
UnpackManifestFile,
|
|
||||||
Done,
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly DefaultBuildinFileSystem _fileSystem;
|
|
||||||
private RequestBuildinPackageVersionOperation _requestBuildinPackageVersionOp;
|
|
||||||
private UnityWebFileRequestOperation _hashFileRequestOp;
|
|
||||||
private UnityWebFileRequestOperation _manifestFileRequestOp;
|
|
||||||
private string _buildinPackageVersion;
|
|
||||||
private ESteps _steps = ESteps.None;
|
|
||||||
|
|
||||||
public CopyBuildinPackageManifestOperation(DefaultBuildinFileSystem fileSystem)
|
|
||||||
{
|
|
||||||
_fileSystem = fileSystem;
|
|
||||||
}
|
|
||||||
internal override void InternalOnStart()
|
|
||||||
{
|
|
||||||
_steps = ESteps.RequestPackageVersion;
|
|
||||||
}
|
|
||||||
internal override void InternalOnUpdate()
|
|
||||||
{
|
|
||||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_steps == ESteps.RequestPackageVersion)
|
|
||||||
{
|
|
||||||
if (_requestBuildinPackageVersionOp == null)
|
|
||||||
{
|
|
||||||
_requestBuildinPackageVersionOp = new RequestBuildinPackageVersionOperation(_fileSystem);
|
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _requestBuildinPackageVersionOp);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_requestBuildinPackageVersionOp.IsDone == false)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_requestBuildinPackageVersionOp.Status == EOperationStatus.Succeed)
|
|
||||||
{
|
|
||||||
_steps = ESteps.CheckHashFile;
|
|
||||||
_buildinPackageVersion = _requestBuildinPackageVersionOp.PackageVersion;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_steps = ESteps.Done;
|
|
||||||
Status = EOperationStatus.Failed;
|
|
||||||
Error = _requestBuildinPackageVersionOp.Error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_steps == ESteps.CheckHashFile)
|
|
||||||
{
|
|
||||||
string hashFilePath = GetCopyPackageHashDestPath(_buildinPackageVersion);
|
|
||||||
if (File.Exists(hashFilePath))
|
|
||||||
{
|
|
||||||
_steps = ESteps.CheckManifestFile;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_steps = ESteps.UnpackHashFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_steps == ESteps.UnpackHashFile)
|
|
||||||
{
|
|
||||||
if (_hashFileRequestOp == null)
|
|
||||||
{
|
|
||||||
string sourcePath = _fileSystem.GetBuildinPackageHashFilePath(_buildinPackageVersion);
|
|
||||||
string destPath = GetCopyPackageHashDestPath(_buildinPackageVersion);
|
|
||||||
string url = DownloadSystemHelper.ConvertToWWWPath(sourcePath);
|
|
||||||
_hashFileRequestOp = new UnityWebFileRequestOperation(url, destPath);
|
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _hashFileRequestOp);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_hashFileRequestOp.IsDone == false)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_hashFileRequestOp.Status == EOperationStatus.Succeed)
|
|
||||||
{
|
|
||||||
_steps = ESteps.CheckManifestFile;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_steps = ESteps.Done;
|
|
||||||
Status = EOperationStatus.Failed;
|
|
||||||
Error = _hashFileRequestOp.Error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_steps == ESteps.CheckManifestFile)
|
|
||||||
{
|
|
||||||
string manifestFilePath = GetCopyPackageManifestDestPath(_buildinPackageVersion);
|
|
||||||
if (File.Exists(manifestFilePath))
|
|
||||||
{
|
|
||||||
_steps = ESteps.Done;
|
|
||||||
Status = EOperationStatus.Succeed;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_steps = ESteps.UnpackManifestFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_steps == ESteps.UnpackManifestFile)
|
|
||||||
{
|
|
||||||
if (_manifestFileRequestOp == null)
|
|
||||||
{
|
|
||||||
string sourcePath = _fileSystem.GetBuildinPackageManifestFilePath(_buildinPackageVersion);
|
|
||||||
string destPath = GetCopyPackageManifestDestPath(_buildinPackageVersion);
|
|
||||||
string url = DownloadSystemHelper.ConvertToWWWPath(sourcePath);
|
|
||||||
_manifestFileRequestOp = new UnityWebFileRequestOperation(url, destPath);
|
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _manifestFileRequestOp);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_manifestFileRequestOp.IsDone == false)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_manifestFileRequestOp.Status == EOperationStatus.Succeed)
|
|
||||||
{
|
|
||||||
_steps = ESteps.Done;
|
|
||||||
Status = EOperationStatus.Succeed;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_steps = ESteps.Done;
|
|
||||||
Status = EOperationStatus.Failed;
|
|
||||||
Error = _manifestFileRequestOp.Error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetCopyManifestFileRoot()
|
|
||||||
{
|
|
||||||
string destRoot = _fileSystem.CopyBuildinPackageManifestDestRoot;
|
|
||||||
if (string.IsNullOrEmpty(destRoot))
|
|
||||||
{
|
|
||||||
string defaultCacheRoot = YooAssetSettingsData.GetYooDefaultCacheRoot();
|
|
||||||
destRoot = PathUtility.Combine(defaultCacheRoot, _fileSystem.PackageName, DefaultCacheFileSystemDefine.ManifestFilesFolderName);
|
|
||||||
}
|
|
||||||
return destRoot;
|
|
||||||
}
|
|
||||||
private string GetCopyPackageHashDestPath(string packageVersion)
|
|
||||||
{
|
|
||||||
string fileRoot = GetCopyManifestFileRoot();
|
|
||||||
string fileName = YooAssetSettingsData.GetPackageHashFileName(_fileSystem.PackageName, packageVersion);
|
|
||||||
return PathUtility.Combine(fileRoot, fileName);
|
|
||||||
}
|
|
||||||
private string GetCopyPackageManifestDestPath(string packageVersion)
|
|
||||||
{
|
|
||||||
string fileRoot = GetCopyManifestFileRoot();
|
|
||||||
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(_fileSystem.PackageName, packageVersion);
|
|
||||||
return PathUtility.Combine(fileRoot, fileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 69f62f6b4185d06498f96aa272e9b926
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
|
@ -473,7 +473,16 @@ namespace YooAsset
|
||||||
#region 内部方法
|
#region 内部方法
|
||||||
public string GetDefaultCachePackageRoot(string packageName)
|
public string GetDefaultCachePackageRoot(string packageName)
|
||||||
{
|
{
|
||||||
string rootDirectory = YooAssetSettingsData.GetYooDefaultCacheRoot();
|
string rootDirectory;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
rootDirectory = YooAssetSettingsData.GetYooEditorCacheRoot();
|
||||||
|
#elif UNITY_STANDALONE
|
||||||
|
rootDirectory = YooAssetSettingsData.GetYooStandaloneCacheRoot();
|
||||||
|
#else
|
||||||
|
rootDirectory = YooAssetSettingsData.GetYooMobileCacheRoot();
|
||||||
|
#endif
|
||||||
|
|
||||||
return PathUtility.Combine(rootDirectory, packageName);
|
return PathUtility.Combine(rootDirectory, packageName);
|
||||||
}
|
}
|
||||||
public string GetCacheBundleFileLoadPath(PackageBundle bundle)
|
public string GetCacheBundleFileLoadPath(PackageBundle bundle)
|
||||||
|
|
|
@ -174,17 +174,17 @@ namespace YooAsset
|
||||||
public string GetEditorPackageVersionFilePath()
|
public string GetEditorPackageVersionFilePath()
|
||||||
{
|
{
|
||||||
string fileName = YooAssetSettingsData.GetPackageVersionFileName(PackageName);
|
string fileName = YooAssetSettingsData.GetPackageVersionFileName(PackageName);
|
||||||
return PathUtility.Combine(_packageRoot, fileName);
|
return PathUtility.Combine(FileRoot, fileName);
|
||||||
}
|
}
|
||||||
public string GetEditorPackageHashFilePath(string packageVersion)
|
public string GetEditorPackageHashFilePath(string packageVersion)
|
||||||
{
|
{
|
||||||
string fileName = YooAssetSettingsData.GetPackageHashFileName(PackageName, packageVersion);
|
string fileName = YooAssetSettingsData.GetPackageHashFileName(PackageName, packageVersion);
|
||||||
return PathUtility.Combine(_packageRoot, fileName);
|
return PathUtility.Combine(FileRoot, fileName);
|
||||||
}
|
}
|
||||||
public string GetEditorPackageManifestFilePath(string packageVersion)
|
public string GetEditorPackageManifestFilePath(string packageVersion)
|
||||||
{
|
{
|
||||||
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(PackageName, packageVersion);
|
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(PackageName, packageVersion);
|
||||||
return PathUtility.Combine(_packageRoot, fileName);
|
return PathUtility.Combine(FileRoot, fileName);
|
||||||
}
|
}
|
||||||
public int GetAsyncSimulateFrame()
|
public int GetAsyncSimulateFrame()
|
||||||
{
|
{
|
||||||
|
|
|
@ -168,7 +168,7 @@ namespace YooAsset
|
||||||
#region 内部方法
|
#region 内部方法
|
||||||
protected string GetDefaultWebPackageRoot(string packageName)
|
protected string GetDefaultWebPackageRoot(string packageName)
|
||||||
{
|
{
|
||||||
string rootDirectory = YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
string rootDirectory = YooAssetSettingsData.GetYooWebBuildinRoot();
|
||||||
return PathUtility.Combine(rootDirectory, packageName);
|
return PathUtility.Combine(rootDirectory, packageName);
|
||||||
}
|
}
|
||||||
public string GetWebFileLoadPath(PackageBundle bundle)
|
public string GetWebFileLoadPath(PackageBundle bundle)
|
||||||
|
|
|
@ -37,7 +37,8 @@ namespace YooAsset
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
// 兼容性初始化
|
// 兼容性初始化
|
||||||
// 说明:内置文件系统在编辑器下运行时需要动态生成
|
// 说明:内置文件系统在编辑器下运行时需要动态生成
|
||||||
string packageRoot = _fileSystem.FileRoot;
|
string buildinRoot = YooAssetSettingsData.GetYooEditorBuildinRoot();
|
||||||
|
string packageRoot = PathUtility.Combine(buildinRoot, _fileSystem.PackageName);
|
||||||
bool result = DefaultBuildinFileSystemBuild.CreateBuildinCatalogFile(_fileSystem.PackageName, packageRoot);
|
bool result = DefaultBuildinFileSystemBuild.CreateBuildinCatalogFile(_fileSystem.PackageName, packageRoot);
|
||||||
if (result == false)
|
if (result == false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,5 @@ namespace YooAsset
|
||||||
public const string RESUME_DOWNLOAD_RESPONSE_CODES = "RESUME_DOWNLOAD_RESPONSE_CODES";
|
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_MIN_FRAME = "ASYNC_SIMULATE_MIN_FRAME";
|
||||||
public const string ASYNC_SIMULATE_MAX_FRAME = "ASYNC_SIMULATE_MAX_FRAME";
|
public const string ASYNC_SIMULATE_MAX_FRAME = "ASYNC_SIMULATE_MAX_FRAME";
|
||||||
public const string COPY_BUILDIN_PACKAGE_MANIFEST = "COPY_BUILDIN_PACKAGE_MANIFEST";
|
|
||||||
public const string COPY_BUILDIN_PACKAGE_MANIFEST_DEST_ROOT = "COPY_BUILDIN_PACKAGE_MANIFEST_DEST_ROOT";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -111,6 +111,50 @@ namespace YooAsset
|
||||||
return $"Assets/Resources/{Setting.DefaultYooFolderName}";
|
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>
|
/// <summary>
|
||||||
/// 获取YOO的编辑器下缓存文件根目录
|
/// 获取YOO的编辑器下缓存文件根目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -152,31 +196,6 @@ namespace YooAsset
|
||||||
else
|
else
|
||||||
return PathUtility.Combine(Application.persistentDataPath, Setting.DefaultYooFolderName);
|
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
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -123,7 +123,7 @@ public class CopyBuildinManifestOperation : GameAsyncOperation
|
||||||
|
|
||||||
private string GetBuildinYooRoot()
|
private string GetBuildinYooRoot()
|
||||||
{
|
{
|
||||||
return YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
return YooAssetSettingsData.GetYooMobileBuildinRoot();
|
||||||
}
|
}
|
||||||
private string GetBuildinHashFilePath()
|
private string GetBuildinHashFilePath()
|
||||||
{
|
{
|
||||||
|
@ -140,7 +140,7 @@ public class CopyBuildinManifestOperation : GameAsyncOperation
|
||||||
|
|
||||||
private string GetCacheYooRoot()
|
private string GetCacheYooRoot()
|
||||||
{
|
{
|
||||||
return YooAssetSettingsData.GetYooDefaultCacheRoot();
|
return YooAssetSettingsData.GetYooMobileCacheRoot();
|
||||||
}
|
}
|
||||||
private string GetCacheHashFilePath()
|
private string GetCacheHashFilePath()
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class GetCacheBundleSizeOperation : GameAsyncOperation
|
||||||
|
|
||||||
private string GetCacheDirectoryRoot()
|
private string GetCacheDirectoryRoot()
|
||||||
{
|
{
|
||||||
string rootDirectory = YooAssetSettingsData.GetYooDefaultCacheRoot();
|
string rootDirectory = YooAssetSettingsData.GetYooMobileCacheRoot();
|
||||||
string packageRoot = PathUtility.Combine(rootDirectory, _packageName);
|
string packageRoot = PathUtility.Combine(rootDirectory, _packageName);
|
||||||
return PathUtility.Combine(packageRoot, DefaultCacheFileSystemDefine.BundleFilesFolderName);
|
return PathUtility.Combine(packageRoot, DefaultCacheFileSystemDefine.BundleFilesFolderName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue