From c782e8154bb9d740c5ee0c4e8fba5199a07d169b Mon Sep 17 00:00:00 2001 From: hevinci Date: Tue, 19 Jul 2022 16:30:18 +0800 Subject: [PATCH] Update document --- Docs/AssetBuilder.md | 10 +++++++--- Docs/CodeTutorial1.md | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Docs/AssetBuilder.md b/Docs/AssetBuilder.md index 2215e78..3ad023d 100644 --- a/Docs/AssetBuilder.md +++ b/Docs/AssetBuilder.md @@ -104,6 +104,8 @@ public class GameEncryption : IEncryptionServices 如果需要自动化构建,可以参考如下代码范例: +使用内置构建管线来构建资源包。 + ````c# private static void BuildInternal(BuildTarget buildTarget) { @@ -114,9 +116,10 @@ private static void BuildInternal(BuildTarget buildTarget) // 构建参数 string defaultOutputRoot = AssetBundleBuilderHelper.GetDefaultOutputRoot(); - AssetBundleBuilder.BuildParameters buildParameters = new AssetBundleBuilder.BuildParameters(); + BuildParameters buildParameters = new BuildParameters(); buildParameters.OutputRoot = defaultOutputRoot; buildParameters.BuildTarget = buildTarget; + buildParameters.BuildPipeline = EBuildPipeline.BuiltinBuildPipeline; buildParameters.BuildMode = EBuildMode.ForceRebuild; buildParameters.BuildVersion = buildVersion; buildParameters.BuildinTags = "buildin"; @@ -126,10 +129,11 @@ private static void BuildInternal(BuildTarget buildTarget) buildParameters.CopyBuildinTagFiles = true; buildParameters.EncryptionServices = new GameEncryption(); buildParameters.CompressOption = ECompressOption.LZ4; - + // 执行构建 AssetBundleBuilder builder = new AssetBundleBuilder(); - builder.Run(buildParameters); + bool succeed = builder.Run(buildParameters); + Debug.Log($"构建结果:{succeed}"); } // 从构建命令里获取参数 diff --git a/Docs/CodeTutorial1.md b/Docs/CodeTutorial1.md index a1476c9..f252587 100644 --- a/Docs/CodeTutorial1.md +++ b/Docs/CodeTutorial1.md @@ -68,8 +68,8 @@ private IEnumerator InitializeYooAsset() initParameters.LocationServices = new DefaultLocationServices("Assets/GameRes"); initParameters.DecryptionServices = null; initParameters.ClearCacheWhenDirty = false; - initParameters.DefaultHostServer = "http://127.0.0.1/CDN1/Android"; - initParameters.FallbackHostServer = "http://127.0.0.1/CDN2/Android"; + initParameters.DefaultHostServer = "http://127.0.0.1/CDN1/Android/v1.0"; + initParameters.FallbackHostServer = "http://127.0.0.1/CDN2/Android/v1.0"; initParameters.VerifyLevel = EVerifyLevel.High; yield return YooAssets.InitializeAsync(initParameters); } @@ -80,7 +80,7 @@ private IEnumerator InitializeYooAsset() ````c# public class BundleDecryption : IDecryptionServices { - public ulong GetFileOffset() + public ulong GetFileOffset(DecryptionFileInfo fileInfo) { return 32; }