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.BuildVersion = buildVersion;
buildParameters.CompressOption = ECompressOption.LZ4;
buildParameters.AppendFileExtension = false;
buildParameters.AppendFileExtension = false;
buildParameters.IsForceRebuild = isForceBuild;
buildParameters.BuildinTags = "buildin";

View File

@ -67,7 +67,7 @@ public class CollectScene : IFilterRule
````xml
<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=""/>
</root>
````

View File

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

View File

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

View File

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

View File

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