Update document
parent
b3fcbf85ff
commit
50492821f1
|
@ -16,6 +16,14 @@
|
|||
|
||||
资源包的压缩方式。
|
||||
|
||||
- **Encryption Services**
|
||||
|
||||
加密服务类列表。
|
||||
|
||||
- **Redundancy Services**
|
||||
|
||||
冗余服务类列表。
|
||||
|
||||
- **Append Extension**
|
||||
|
||||
构建的资源包文件名是否包含后缀格式。
|
||||
|
@ -37,14 +45,15 @@
|
|||
编写继承IAssetEncrypter接口的加密类。注意:加密类文件需要放置在Editor文件夹里。
|
||||
|
||||
````C#
|
||||
using System;
|
||||
using YooAsset.Editor;
|
||||
|
||||
public class AssetEncrypter : IAssetEncrypter
|
||||
public class GameEncryption : IEncryptionServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 检测资源包是否需要加密
|
||||
/// </summary>
|
||||
bool IAssetEncrypter.Check(string filePath)
|
||||
bool IEncryptionServices.Check(string filePath)
|
||||
{
|
||||
// 对配置表相关的资源包进行加密
|
||||
return filePath.Contains("Assets/Config/");
|
||||
|
@ -53,7 +62,7 @@ public class AssetEncrypter : IAssetEncrypter
|
|||
/// <summary>
|
||||
/// 对数据进行加密,并返回加密后的数据
|
||||
/// </summary>
|
||||
byte[] IAssetEncrypter.Encrypt(byte[] fileData)
|
||||
byte[] IEncryptionServices.Encrypt(byte[] fileData)
|
||||
{
|
||||
int offset = 32;
|
||||
var temper = new byte[fileData.Length + offset];
|
||||
|
@ -67,7 +76,9 @@ public class AssetEncrypter : IAssetEncrypter
|
|||
|
||||
构建成功后会在输出目录下找到补丁包文件夹,该文件夹名称为本次构建时指定的资源版本号。
|
||||
|
||||
补丁包文件夹里包含补丁清单和资源包文件以及说明文件,资源包文件都是以文件的哈希值命名。
|
||||
补丁包文件夹里包含补丁清单文件,资源包文件,构建报告文件等。
|
||||
|
||||
资源包文件都是以文件的哈希值命名。
|
||||
|
||||
![image](https://github.com/tuyoogame/YooAsset/raw/main/Docs/Image/AssetBuilder-img4.jpg)
|
||||
|
||||
|
@ -86,11 +97,8 @@ private static void BuildInternal(BuildTarget buildTarget)
|
|||
{
|
||||
Debug.Log($"开始构建 : {buildTarget}");
|
||||
|
||||
// 打印命令行参数
|
||||
// 命令行参数
|
||||
int buildVersion = GetBuildVersion();
|
||||
bool isForceBuild = IsForceBuild();
|
||||
Debug.Log($"资源版本 : {buildVersion}");
|
||||
Debug.Log($"强制重建 : {isForceBuild}");
|
||||
|
||||
// 构建参数
|
||||
string defaultOutputRoot = AssetBundleBuilderHelper.GetDefaultOutputRoot();
|
||||
|
@ -101,7 +109,9 @@ private static void BuildInternal(BuildTarget buildTarget)
|
|||
buildParameters.BuildVersion = buildVersion;
|
||||
buildParameters.CompressOption = ECompressOption.LZ4;
|
||||
buildParameters.AppendFileExtension = false;
|
||||
buildParameters.IsForceRebuild = isForceBuild;
|
||||
buildParameters.EncryptionServices = new GameEncryption();
|
||||
buildParameters.RedundancyServices = null;
|
||||
buildParameters.IsForceRebuild = true;
|
||||
buildParameters.BuildinTags = "buildin";
|
||||
|
||||
// 执行构建
|
||||
|
@ -122,14 +132,5 @@ private static int GetBuildVersion()
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
private static bool IsForceBuild()
|
||||
{
|
||||
foreach (string arg in System.Environment.GetCommandLineArgs())
|
||||
{
|
||||
if (arg.StartsWith("forceBuild"))
|
||||
return arg.Split("="[0])[1] == "true" ? true : false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
````
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ IEnumerator Start()
|
|||
IEnumerator Start()
|
||||
{
|
||||
string location = "wwise/init.bnk";
|
||||
string savePath = $"{Application.persistentDataPath}/Audio/init.bnk"
|
||||
string savePath = $"{Application.persistentDataPath}/Audio/init.bnk";
|
||||
RawFileOperation operation = YooAssets.LoadRawFileAsync(location, savePath);
|
||||
yield return operation;
|
||||
byte[] fileData = operation.GetFileData();
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 45 KiB |
Binary file not shown.
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 68 KiB |
Binary file not shown.
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 33 KiB |
|
@ -10,11 +10,7 @@
|
|||
|
||||
- **Asset Bundle File Variant** : AssetBundle资源包后缀名
|
||||
- **Raw File Variant** : 原生资源包后缀名
|
||||
|
||||
- **Patch Manifest File Name** : 补丁清单文件名
|
||||
|
||||
- **Patch Manifest Hash File Name** : 补丁清单哈希文件名
|
||||
|
||||
- **Unity Manifest File Name** : Unity构建的清单名称
|
||||
- **Readme File Name** : 说明文件名称
|
||||
|
||||
|
|
Loading…
Reference in New Issue