Update document

pull/4/head
hevinci 2022-03-03 18:40:58 +08:00
parent 0237f00751
commit 8b08907ea8
6 changed files with 42 additions and 41 deletions

View File

@ -98,7 +98,7 @@ private static void BuildInternal(BuildTarget buildTarget)
buildParameters.BuildTarget = buildTarget; buildParameters.BuildTarget = buildTarget;
buildParameters.BuildVersion = buildVersion; buildParameters.BuildVersion = buildVersion;
buildParameters.CompressOption = ECompressOption.LZ4; buildParameters.CompressOption = ECompressOption.LZ4;
buildParameters.AppendFileExtension = false; buildParameters.AppendFileExtension = false;
buildParameters.IsForceRebuild = isForceBuild; buildParameters.IsForceRebuild = isForceBuild;
buildParameters.BuildinTags = "buildin"; buildParameters.BuildinTags = "buildin";

View File

@ -67,7 +67,7 @@ public class CollectScene : IFilterRule
````xml ````xml
<root> <root>
<Collector Directory="Assets/GameRes/UIAtlas/" PackRule="PackExplicit" FilterRule="CollectAll" DontWriteAssetPath="0" AssetTags=""/> <Collector Directory="Assets/GameRes/UIAtlas/" PackRule="PackExplicit" FilterRule="CollectAll" DontWriteAssetPath="0" AssetTags=""/>
<Collector Directory="Assets/GameRes/UIPanel/" PackRule="PackExplicit" FilterRule="CollectAll" DontWriteAssetPath="0" AssetTags=""/> <Collector Directory="Assets/GameRes/UIPanel/" PackRule="PackExplicit" FilterRule="CollectAll" DontWriteAssetPath="0" AssetTags=""/>
</root> </root>
```` ````

View File

@ -54,7 +54,7 @@ private IEnumerator InitializeYooAsset()
private IEnumerator InitializeYooAsset() private IEnumerator InitializeYooAsset()
{ {
var createParameters = new YooAssets.HostPlayModeParameters(); var createParameters = new YooAssets.HostPlayModeParameters();
createParameters.LocationRoot = "Assets/GameRes"; createParameters.LocationRoot = "Assets/GameRes";
createParameters.DecryptServices = null; createParameters.DecryptServices = null;
createParameters.ClearCacheWhenDirty = false; createParameters.ClearCacheWhenDirty = false;
createParameters.IgnoreResourceVersion = false; createParameters.IgnoreResourceVersion = false;

View File

@ -57,7 +57,7 @@ async Task AsyncLoad()
{ {
AssetOperationHandle handle = YooAssets.LoadAssetAsync<AudioClip>("Audio/bgMusic.mp3"); AssetOperationHandle handle = YooAssets.LoadAssetAsync<AudioClip>("Audio/bgMusic.mp3");
await handle.Task; await handle.Task;
AudioClip audioClip = handle.AssetObject as AudioClip; AudioClip audioClip = handle.AssetObject as AudioClip;
} }
```` ````

View File

@ -9,18 +9,18 @@
````c# ````c#
private IEnumerator UpdatePatchManifest() private IEnumerator UpdatePatchManifest()
{ {
int updateResourceVersion = 123; int updateResourceVersion = 123;
int timeout = 30; int timeout = 30;
UpdateManifestOperation operation = YooAssets.UpdateManifestAsync(updateResourceVersion, timeout); UpdateManifestOperation operation = YooAssets.UpdateManifestAsync(updateResourceVersion, timeout);
yield return operation; yield return operation;
if(operation.Status == EOperationStatus.Succeed) if (operation.Status == EOperationStatus.Succeed)
{ {
//更新成功 //更新成功
} }
else else
{ {
//更新失败 //更新失败
Debug.LogError(operation.Error); Debug.LogError(operation.Error);
} }
} }
@ -41,19 +41,19 @@ private PatchDownloader _downloader;
private void CreateDownloader() private void CreateDownloader()
{ {
string[] tags = { "buildin", "config" }; string[] tags = { "buildin", "config" };
int downloadingMaxNum = 10; int downloadingMaxNum = 10;
int failedTryAgain = 3; int failedTryAgain = 3;
_downloader = YooAssets.CreateDLCDownloader(tags, 10, 3); _downloader = YooAssets.CreateDLCDownloader(tags, 10, 3);
if (_downloader.TotalDownloadCount == 0) if (_downloader.TotalDownloadCount == 0)
{ {
//没有需要下载的资源 //没有需要下载的资源
} }
else else
{ {
//需要下载的文件总数和总大小 //需要下载的文件总数和总大小
int totalDownloadCount = _downloader.TotalDownloadCount; int totalDownloadCount = _downloader.TotalDownloadCount;
long totalDownloadBytes = _downloader.TotalDownloadBytes; long totalDownloadBytes = _downloader.TotalDownloadBytes;
} }
} }
/// <summary> /// <summary>
@ -61,8 +61,8 @@ private void CreateDownloader()
/// </summary> /// </summary>
private void UpdateDownloader() private void UpdateDownloader()
{ {
if(_downloader != null) if (_downloader != null)
_downloader.Update(); _downloader.Update();
} }
/// <summary> /// <summary>
@ -73,19 +73,19 @@ private IEnumerator Download()
//注册下载回调 //注册下载回调
_downloader.OnPatchFileDownloadFailedCallback = OnPatchFileDownloadFailed; _downloader.OnPatchFileDownloadFailedCallback = OnPatchFileDownloadFailed;
_downloader.OnDownloadProgressCallback = OnDownloadProgressUpdate; _downloader.OnDownloadProgressCallback = OnDownloadProgressUpdate;
_downloader.OnDownloadOverCallback = OnDownloadOver; _downloader.OnDownloadOverCallback = OnDownloadOver;
_downloader.Download(); _downloader.Download();
yield return _downloader; yield return _downloader;
//检测下载结果 //检测下载结果
if (_downloader.DownloadStates == EDownloaderStates.Succeed) if (_downloader.DownloadStates == EDownloaderStates.Succeed)
{ {
//下载成功 //下载成功
} }
else else
{ {
//下载失败 //下载失败
} }
} }
/// <summary> /// <summary>
@ -93,7 +93,7 @@ private IEnumerator Download()
/// </summary> /// </summary>
private void OnPatchFileDownloadFailed(string fileName) private void OnPatchFileDownloadFailed(string fileName)
{ {
Debug.LogError($"File download failed : {fileName}"); Debug.LogError($"File download failed : {fileName}");
} }
/// <summary> /// <summary>

View File

@ -31,13 +31,14 @@ YooAsset是一个基于Unity3D引擎的资源管理插件。
支持线上版本快速回退,支持区分审核版本,测试版本,线上版本,支持灰度更新及测试。 支持线上版本快速回退,支持区分审核版本,测试版本,线上版本,支持灰度更新及测试。
## 入门教程 ## 入门教程
**1. 快速开始** 1. [快速开始](https://github.com/tuyoogame/YooAsset/blob/master/Docs/QuickStart.md)
**2. 全局配置** 2. [全局配置](https://github.com/tuyoogame/YooAsset/blob/master/Docs/Settings.md)
**3. 资源收集** 3. [资源收集](https://github.com/tuyoogame/YooAsset/blob/master/Docs/AssetCollector.md)
**4. 资源打包** 4. [资源打包](https://github.com/tuyoogame/YooAsset/blob/master/Docs/AssetBuilder.md)
**5. 资源部署** 5. [资源部署](https://github.com/tuyoogame/YooAsset/blob/master/Docs/AssetDeploy.md)
## 代码教程 ## 代码教程
**1. 初始化** 1. [初始化](https://github.com/tuyoogame/YooAsset/blob/master/Docs/YooAssetInit.md)
**2. 资源更新** 2. [资源更新](https://github.com/tuyoogame/YooAsset/blob/master/Docs/YooAssetUpdater.md)
**3. 资源加载** 3. [资源加载](https://github.com/tuyoogame/YooAsset/blob/master/Docs/YooAssetLoader.md)