mirror of https://github.com/tuyoogame/YooAsset
Update document
parent
77c387bfe9
commit
c782e8154b
|
@ -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";
|
||||
|
@ -129,7 +132,8 @@ private static void BuildInternal(BuildTarget buildTarget)
|
|||
|
||||
// 执行构建
|
||||
AssetBundleBuilder builder = new AssetBundleBuilder();
|
||||
builder.Run(buildParameters);
|
||||
bool succeed = builder.Run(buildParameters);
|
||||
Debug.Log($"构建结果:{succeed}");
|
||||
}
|
||||
|
||||
// 从构建命令里获取参数
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue