mirror of https://github.com/tuyoogame/YooAsset
Compare commits
5 Commits
3f786bca3b
...
b0dc829b04
Author | SHA1 | Date |
---|---|---|
|
b0dc829b04 | |
|
b3ead90832 | |
|
7bf00d4ff6 | |
|
030e94d8ff | |
|
cf05254121 |
|
@ -58,6 +58,11 @@ namespace YooAsset
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EFileVerifyLevel FileVerifyLevel { private set; get; } = EFileVerifyLevel.Middle;
|
public EFileVerifyLevel FileVerifyLevel { private set; get; } = EFileVerifyLevel.Middle;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 自定义参数:覆盖安装缓存清理模式
|
||||||
|
/// </summary>
|
||||||
|
public EOverwriteInstallClearMode InstallClearMode { private set; get; } = EOverwriteInstallClearMode.ClearAllManifestFiles;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义参数:数据文件追加文件格式
|
/// 自定义参数:数据文件追加文件格式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -145,6 +150,10 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
FileVerifyLevel = (EFileVerifyLevel)value;
|
FileVerifyLevel = (EFileVerifyLevel)value;
|
||||||
}
|
}
|
||||||
|
else if (name == FileSystemParametersDefine.INSTALL_CLEAR_MODE)
|
||||||
|
{
|
||||||
|
InstallClearMode = (EOverwriteInstallClearMode)value;
|
||||||
|
}
|
||||||
else if (name == FileSystemParametersDefine.APPEND_FILE_EXTENSION)
|
else if (name == FileSystemParametersDefine.APPEND_FILE_EXTENSION)
|
||||||
{
|
{
|
||||||
AppendFileExtension = Convert.ToBoolean(value);
|
AppendFileExtension = Convert.ToBoolean(value);
|
||||||
|
@ -184,6 +193,7 @@ namespace YooAsset
|
||||||
_unpackFileSystem = new DefaultUnpackFileSystem();
|
_unpackFileSystem = new DefaultUnpackFileSystem();
|
||||||
_unpackFileSystem.SetParameter(FileSystemParametersDefine.REMOTE_SERVICES, remoteServices);
|
_unpackFileSystem.SetParameter(FileSystemParametersDefine.REMOTE_SERVICES, remoteServices);
|
||||||
_unpackFileSystem.SetParameter(FileSystemParametersDefine.FILE_VERIFY_LEVEL, FileVerifyLevel);
|
_unpackFileSystem.SetParameter(FileSystemParametersDefine.FILE_VERIFY_LEVEL, FileVerifyLevel);
|
||||||
|
_unpackFileSystem.SetParameter(FileSystemParametersDefine.INSTALL_CLEAR_MODE, InstallClearMode);
|
||||||
_unpackFileSystem.SetParameter(FileSystemParametersDefine.APPEND_FILE_EXTENSION, AppendFileExtension);
|
_unpackFileSystem.SetParameter(FileSystemParametersDefine.APPEND_FILE_EXTENSION, AppendFileExtension);
|
||||||
_unpackFileSystem.SetParameter(FileSystemParametersDefine.DECRYPTION_SERVICES, DecryptionServices);
|
_unpackFileSystem.SetParameter(FileSystemParametersDefine.DECRYPTION_SERVICES, DecryptionServices);
|
||||||
_unpackFileSystem.OnCreate(packageName, null);
|
_unpackFileSystem.OnCreate(packageName, null);
|
||||||
|
|
|
@ -69,8 +69,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.VerifyFileData)
|
if (_steps == ESteps.VerifyFileData)
|
||||||
{
|
{
|
||||||
string fileHash = HashUtility.BytesCRC32(_webDataRequestOp.Result);
|
if (ManifestTools.VerifyManifestData(_webDataRequestOp.Result, _packageHash))
|
||||||
if (fileHash == _packageHash)
|
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadManifest;
|
_steps = ESteps.LoadManifest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,11 @@ namespace YooAsset
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EFileVerifyLevel FileVerifyLevel { private set; get; } = EFileVerifyLevel.Middle;
|
public EFileVerifyLevel FileVerifyLevel { private set; get; } = EFileVerifyLevel.Middle;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 自定义参数:覆盖安装缓存清理模式
|
||||||
|
/// </summary>
|
||||||
|
public EOverwriteInstallClearMode InstallClearMode { private set; get; } = EOverwriteInstallClearMode.ClearAllManifestFiles;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义参数:数据文件追加文件格式
|
/// 自定义参数:数据文件追加文件格式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -188,6 +193,10 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
FileVerifyLevel = (EFileVerifyLevel)value;
|
FileVerifyLevel = (EFileVerifyLevel)value;
|
||||||
}
|
}
|
||||||
|
else if (name == FileSystemParametersDefine.INSTALL_CLEAR_MODE)
|
||||||
|
{
|
||||||
|
InstallClearMode = (EOverwriteInstallClearMode)value;
|
||||||
|
}
|
||||||
else if (name == FileSystemParametersDefine.APPEND_FILE_EXTENSION)
|
else if (name == FileSystemParametersDefine.APPEND_FILE_EXTENSION)
|
||||||
{
|
{
|
||||||
AppendFileExtension = Convert.ToBoolean(value);
|
AppendFileExtension = Convert.ToBoolean(value);
|
||||||
|
@ -227,8 +236,8 @@ namespace YooAsset
|
||||||
_packageRoot = packageRoot;
|
_packageRoot = packageRoot;
|
||||||
|
|
||||||
_cacheBundleFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.BundleFilesFolderName);
|
_cacheBundleFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.BundleFilesFolderName);
|
||||||
_tempFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.TempFilesFolderName);
|
|
||||||
_cacheManifestFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.ManifestFilesFolderName);
|
_cacheManifestFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.ManifestFilesFolderName);
|
||||||
|
_tempFilesRoot = PathUtility.Combine(_packageRoot, DefaultCacheFileSystemDefine.TempFilesFolderName);
|
||||||
}
|
}
|
||||||
public virtual void OnDestroy()
|
public virtual void OnDestroy()
|
||||||
{
|
{
|
||||||
|
@ -500,7 +509,18 @@ namespace YooAsset
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除所有清单文件
|
/// 删除所有缓存的资源文件
|
||||||
|
/// </summary>
|
||||||
|
public void DeleteAllBundleFiles()
|
||||||
|
{
|
||||||
|
if (Directory.Exists(_cacheBundleFilesRoot))
|
||||||
|
{
|
||||||
|
Directory.Delete(_cacheBundleFilesRoot, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除所有缓存的清单文件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void DeleteAllManifestFiles()
|
public void DeleteAllManifestFiles()
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
|
||||||
|
namespace YooAsset
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 覆盖安装清理模式
|
||||||
|
/// </summary>
|
||||||
|
public enum EOverwriteInstallClearMode
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 不做任何处理
|
||||||
|
/// </summary>
|
||||||
|
None = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清理所有缓存文件(包含资源文件和清单文件)
|
||||||
|
/// </summary>
|
||||||
|
ClearAllCacheFiles = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清理所有缓存的资源文件
|
||||||
|
/// </summary>
|
||||||
|
ClearAllBundleFiles = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清理所有缓存的清单文件
|
||||||
|
/// </summary>
|
||||||
|
ClearAllManifestFiles = 3,
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c61fdc079dca97548a0158b8100ec258
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -46,9 +46,32 @@ namespace YooAsset
|
||||||
// 如果水印发生变化,则说明覆盖安装后首次打开游戏
|
// 如果水印发生变化,则说明覆盖安装后首次打开游戏
|
||||||
if (appFootPrint.IsDirty())
|
if (appFootPrint.IsDirty())
|
||||||
{
|
{
|
||||||
_fileSystem.DeleteAllManifestFiles();
|
if (_fileSystem.InstallClearMode == EOverwriteInstallClearMode.None)
|
||||||
|
{
|
||||||
|
YooLogger.Warning("Do nothing when overwrite install application !");
|
||||||
|
}
|
||||||
|
else if (_fileSystem.InstallClearMode == EOverwriteInstallClearMode.ClearAllCacheFiles)
|
||||||
|
{
|
||||||
|
_fileSystem.DeleteAllBundleFiles();
|
||||||
|
_fileSystem.DeleteAllManifestFiles();
|
||||||
|
YooLogger.Warning("Delete all cache files when overwrite install application !");
|
||||||
|
}
|
||||||
|
else if (_fileSystem.InstallClearMode == EOverwriteInstallClearMode.ClearAllBundleFiles)
|
||||||
|
{
|
||||||
|
_fileSystem.DeleteAllBundleFiles();
|
||||||
|
YooLogger.Warning("Delete all bundle files when overwrite install application !");
|
||||||
|
}
|
||||||
|
else if (_fileSystem.InstallClearMode == EOverwriteInstallClearMode.ClearAllManifestFiles)
|
||||||
|
{
|
||||||
|
_fileSystem.DeleteAllManifestFiles();
|
||||||
|
YooLogger.Warning("Delete all manifest files when overwrite install application !");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new System.NotImplementedException(_fileSystem.InstallClearMode.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
appFootPrint.Coverage(_fileSystem.PackageName);
|
appFootPrint.Coverage(_fileSystem.PackageName);
|
||||||
YooLogger.Warning("Delete manifest files when application foot print dirty !");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_steps = ESteps.SearchCacheFiles;
|
_steps = ESteps.SearchCacheFiles;
|
||||||
|
|
|
@ -59,8 +59,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.VerifyFileData)
|
if (_steps == ESteps.VerifyFileData)
|
||||||
{
|
{
|
||||||
string fileHash = HashUtility.BytesCRC32(_fileData);
|
if (ManifestTools.VerifyManifestData(_fileData, _packageHash))
|
||||||
if (fileHash == _packageHash)
|
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadManifest;
|
_steps = ESteps.LoadManifest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,8 +59,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.VerifyFileData)
|
if (_steps == ESteps.VerifyFileData)
|
||||||
{
|
{
|
||||||
string fileHash = HashUtility.BytesCRC32(_fileData);
|
if (ManifestTools.VerifyManifestData(_fileData, _packageHash))
|
||||||
if (fileHash == _packageHash)
|
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadManifest;
|
_steps = ESteps.LoadManifest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,8 @@ namespace YooAsset
|
||||||
base.OnCreate(packageName, rootDirectory);
|
base.OnCreate(packageName, rootDirectory);
|
||||||
|
|
||||||
// 注意:重写保存根目录和临时目录
|
// 注意:重写保存根目录和临时目录
|
||||||
_cacheBundleFilesRoot = PathUtility.Combine(_packageRoot, DefaultUnpackFileSystemDefine.SaveFilesFolderName);
|
_cacheBundleFilesRoot = PathUtility.Combine(_packageRoot, DefaultUnpackFileSystemDefine.SaveBundleFilesFolderName);
|
||||||
|
_cacheManifestFilesRoot = PathUtility.Combine(_packageRoot, DefaultUnpackFileSystemDefine.SaveManifestFilesFolderName);
|
||||||
_tempFilesRoot = PathUtility.Combine(_packageRoot, DefaultUnpackFileSystemDefine.TempFilesFolderName);
|
_tempFilesRoot = PathUtility.Combine(_packageRoot, DefaultUnpackFileSystemDefine.TempFilesFolderName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,13 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保存的资源文件的文件夹名称
|
/// 保存的资源文件的文件夹名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string SaveFilesFolderName = "UnpackFiles";
|
public const string SaveBundleFilesFolderName = "UnpackBundleFiles";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存的清单文件的文件夹名称
|
||||||
|
/// </summary>
|
||||||
|
public const string SaveManifestFilesFolderName = "UnpackManifestFiles";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 下载的临时文件的文件夹名称
|
/// 下载的临时文件的文件夹名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -72,8 +72,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.VerifyFileData)
|
if (_steps == ESteps.VerifyFileData)
|
||||||
{
|
{
|
||||||
string fileHash = HashUtility.BytesCRC32(_webDataRequestOp.Result);
|
if (ManifestTools.VerifyManifestData(_webDataRequestOp.Result, _packageHash))
|
||||||
if (fileHash == _packageHash)
|
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadManifest;
|
_steps = ESteps.LoadManifest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,8 +69,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.VerifyFileData)
|
if (_steps == ESteps.VerifyFileData)
|
||||||
{
|
{
|
||||||
string fileHash = HashUtility.BytesCRC32(_webDataRequestOp.Result);
|
if (ManifestTools.VerifyManifestData(_webDataRequestOp.Result, _packageHash))
|
||||||
if (fileHash == _packageHash)
|
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadManifest;
|
_steps = ESteps.LoadManifest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ namespace YooAsset
|
||||||
public class FileSystemParametersDefine
|
public class FileSystemParametersDefine
|
||||||
{
|
{
|
||||||
public const string FILE_VERIFY_LEVEL = "FILE_VERIFY_LEVEL";
|
public const string FILE_VERIFY_LEVEL = "FILE_VERIFY_LEVEL";
|
||||||
|
public const string INSTALL_CLEAR_MODE = "INSTALL_CLEAR_MODE";
|
||||||
public const string REMOTE_SERVICES = "REMOTE_SERVICES";
|
public const string REMOTE_SERVICES = "REMOTE_SERVICES";
|
||||||
public const string DECRYPTION_SERVICES = "DECRYPTION_SERVICES";
|
public const string DECRYPTION_SERVICES = "DECRYPTION_SERVICES";
|
||||||
public const string APPEND_FILE_EXTENSION = "APPEND_FILE_EXTENSION";
|
public const string APPEND_FILE_EXTENSION = "APPEND_FILE_EXTENSION";
|
||||||
|
|
|
@ -8,6 +8,30 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
internal static class ManifestTools
|
internal static class ManifestTools
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 验证清单文件的二进制数据
|
||||||
|
/// </summary>
|
||||||
|
public static bool VerifyManifestData(byte[] fileData, string hashValue)
|
||||||
|
{
|
||||||
|
if (fileData == null || fileData.Length == 0)
|
||||||
|
return false;
|
||||||
|
if (string.IsNullOrEmpty(hashValue))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// 注意:兼容俩种验证方式
|
||||||
|
// 注意:计算MD5的哈希值通常为32个字符
|
||||||
|
string fileHash;
|
||||||
|
if (hashValue.Length == 32)
|
||||||
|
fileHash = HashUtility.BytesMD5(fileData);
|
||||||
|
else
|
||||||
|
fileHash = HashUtility.BytesCRC32(fileData);
|
||||||
|
|
||||||
|
if (fileHash == hashValue)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序列化(JSON文件)
|
/// 序列化(JSON文件)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -197,9 +221,16 @@ namespace YooAsset
|
||||||
manifest.AssetDic = new Dictionary<string, PackageAsset>(assetCount);
|
manifest.AssetDic = new Dictionary<string, PackageAsset>(assetCount);
|
||||||
|
|
||||||
if (manifest.EnableAddressable)
|
if (manifest.EnableAddressable)
|
||||||
|
{
|
||||||
manifest.AssetPathMapping1 = new Dictionary<string, string>(assetCount * 3);
|
manifest.AssetPathMapping1 = new Dictionary<string, string>(assetCount * 3);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
manifest.AssetPathMapping1 = new Dictionary<string, string>(assetCount * 2);
|
{
|
||||||
|
if (manifest.LocationToLower)
|
||||||
|
manifest.AssetPathMapping1 = new Dictionary<string, string>(assetCount * 2, StringComparer.OrdinalIgnoreCase);
|
||||||
|
else
|
||||||
|
manifest.AssetPathMapping1 = new Dictionary<string, string>(assetCount * 2);
|
||||||
|
}
|
||||||
|
|
||||||
if (manifest.IncludeAssetGUID)
|
if (manifest.IncludeAssetGUID)
|
||||||
manifest.AssetPathMapping2 = new Dictionary<string, string>(assetCount);
|
manifest.AssetPathMapping2 = new Dictionary<string, string>(assetCount);
|
||||||
|
@ -221,8 +252,6 @@ namespace YooAsset
|
||||||
// 填充AssetPathMapping1
|
// 填充AssetPathMapping1
|
||||||
{
|
{
|
||||||
string location = packageAsset.AssetPath;
|
string location = packageAsset.AssetPath;
|
||||||
if (manifest.LocationToLower)
|
|
||||||
location = location.ToLower();
|
|
||||||
|
|
||||||
// 添加原生路径的映射
|
// 添加原生路径的映射
|
||||||
if (manifest.AssetPathMapping1.ContainsKey(location))
|
if (manifest.AssetPathMapping1.ContainsKey(location))
|
||||||
|
|
|
@ -138,9 +138,6 @@ namespace YooAsset
|
||||||
if (string.IsNullOrEmpty(location))
|
if (string.IsNullOrEmpty(location))
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
|
|
||||||
if (LocationToLower)
|
|
||||||
location = location.ToLower();
|
|
||||||
|
|
||||||
if (AssetPathMapping1.TryGetValue(location, out string assetPath))
|
if (AssetPathMapping1.TryGetValue(location, out string assetPath))
|
||||||
return assetPath;
|
return assetPath;
|
||||||
else
|
else
|
||||||
|
@ -307,9 +304,6 @@ namespace YooAsset
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LocationToLower)
|
|
||||||
location = location.ToLower();
|
|
||||||
|
|
||||||
if (AssetPathMapping1.TryGetValue(location, out string assetPath))
|
if (AssetPathMapping1.TryGetValue(location, out string assetPath))
|
||||||
{
|
{
|
||||||
return assetPath;
|
return assetPath;
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class PatchWindow : MonoBehaviour
|
||||||
{
|
{
|
||||||
UserEventDefine.UserTryRequestPackageVersion.SendEventMessage();
|
UserEventDefine.UserTryRequestPackageVersion.SendEventMessage();
|
||||||
};
|
};
|
||||||
ShowMessageBox($"Failed to update static version, please check the network status.", callback);
|
ShowMessageBox($"Failed to request package version, please check the network status.", callback);
|
||||||
}
|
}
|
||||||
else if (message is PatchEventDefine.PackageManifestUpdateFailed)
|
else if (message is PatchEventDefine.PackageManifestUpdateFailed)
|
||||||
{
|
{
|
||||||
|
|
|
@ -71,7 +71,7 @@ public static class TestPackageBuilder
|
||||||
buildParameters.ClearBuildCacheFiles = true;
|
buildParameters.ClearBuildCacheFiles = true;
|
||||||
buildParameters.UseAssetDependencyDB = true;
|
buildParameters.UseAssetDependencyDB = true;
|
||||||
buildParameters.BuiltinShadersBundleName = builtinShaderBundleName;
|
buildParameters.BuiltinShadersBundleName = builtinShaderBundleName;
|
||||||
buildParameters.EncryptionServices = new FileStreamEncryption();
|
buildParameters.EncryptionServices = new FileStreamTestEncryption();
|
||||||
|
|
||||||
var pipeline = new ScriptableBuildPipeline();
|
var pipeline = new ScriptableBuildPipeline();
|
||||||
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
||||||
|
@ -108,7 +108,7 @@ public static class TestPackageBuilder
|
||||||
buildParameters.CompressOption = ECompressOption.LZ4;
|
buildParameters.CompressOption = ECompressOption.LZ4;
|
||||||
buildParameters.ClearBuildCacheFiles = true;
|
buildParameters.ClearBuildCacheFiles = true;
|
||||||
buildParameters.UseAssetDependencyDB = true;
|
buildParameters.UseAssetDependencyDB = true;
|
||||||
buildParameters.EncryptionServices = new FileStreamEncryption();
|
buildParameters.EncryptionServices = new FileStreamTestEncryption();
|
||||||
|
|
||||||
var pipeline = new BuiltinBuildPipeline();
|
var pipeline = new BuiltinBuildPipeline();
|
||||||
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
BuildResult buildResult = pipeline.Run(buildParameters, false);
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class T2_TestBuldinFileSystem : IPrebuildSetup, IPostBuildCleanup
|
||||||
|
|
||||||
// 初始化资源包
|
// 初始化资源包
|
||||||
var initParams = new OfflinePlayModeParameters();
|
var initParams = new OfflinePlayModeParameters();
|
||||||
var decryption = new FileStreamDecryption();
|
var decryption = new FileStreamTestDecryption();
|
||||||
initParams.BuildinFileSystemParameters = FileSystemParameters.CreateDefaultBuildinFileSystemParameters(decryption, packageRoot);
|
initParams.BuildinFileSystemParameters = FileSystemParameters.CreateDefaultBuildinFileSystemParameters(decryption, packageRoot);
|
||||||
var initializeOp = package.InitializeAsync(initParams);
|
var initializeOp = package.InitializeAsync(initParams);
|
||||||
yield return initializeOp;
|
yield return initializeOp;
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class TestBundleEncryption
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件流加密方式
|
/// 文件流加密方式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FileStreamEncryption : IEncryptionServices
|
public class FileStreamTestEncryption : IEncryptionServices
|
||||||
{
|
{
|
||||||
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
|
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ public class FileStreamEncryption : IEncryptionServices
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件偏移加密方式
|
/// 文件偏移加密方式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FileOffsetEncryption : IEncryptionServices
|
public class FileOffsetTestEncryption : IEncryptionServices
|
||||||
{
|
{
|
||||||
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
|
public EncryptResult Encrypt(EncryptFileInfo fileInfo)
|
||||||
{
|
{
|
||||||
|
@ -119,7 +119,7 @@ public class BundleStream : FileStream
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源文件流解密类
|
/// 资源文件流解密类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FileStreamDecryption : IDecryptionServices
|
public class FileStreamTestDecryption : IDecryptionServices
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 同步方式获取解密的资源包对象
|
/// 同步方式获取解密的资源包对象
|
||||||
|
@ -172,7 +172,7 @@ public class FileStreamDecryption : IDecryptionServices
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 资源文件偏移解密类
|
/// 资源文件偏移解密类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FileOffsetDecryption : IDecryptionServices
|
public class FileOffsetTestDecryption : IDecryptionServices
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 同步方式获取解密的资源包对象
|
/// 同步方式获取解密的资源包对象
|
||||||
|
@ -224,7 +224,7 @@ public class FileOffsetDecryption : IDecryptionServices
|
||||||
/// WebGL平台解密类
|
/// WebGL平台解密类
|
||||||
/// 注意:WebGL平台支持内存解密
|
/// 注意:WebGL平台支持内存解密
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class WebFileStreamDecryption : IWebDecryptionServices
|
public class WebFileStreamTestDecryption : IWebDecryptionServices
|
||||||
{
|
{
|
||||||
public WebDecryptResult LoadAssetBundle(WebDecryptFileInfo fileInfo)
|
public WebDecryptResult LoadAssetBundle(WebDecryptFileInfo fileInfo)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue