From 4776ab9bd8a11bafce7f2fd18f921ef703c5448b Mon Sep 17 00:00:00 2001 From: hevinci Date: Mon, 21 Nov 2022 09:52:18 +0800 Subject: [PATCH] Update document --- Docs/CodeTutorial1.md | 4 ++-- Docs/CodeTutorial2.md | 12 ++++++------ Docs/CodeTutorial3.md | 11 +++++------ Docs/CodeTutorial4.md | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Docs/CodeTutorial1.md b/Docs/CodeTutorial1.md index 68a6ad3..e9f31f9 100644 --- a/Docs/CodeTutorial1.md +++ b/Docs/CodeTutorial1.md @@ -7,10 +7,10 @@ YooAssets.Initialize(); // 创建默认的资源包 -var defaultPackage = YooAssets.CreateAssetsPackage("DefaultPackage"); +var package = YooAssets.CreateAssetsPackage("DefaultPackage"); // 设置该资源包为默认的资源包,可以使用YooAssets相关加载接口加载该资源包内容。 -YooAssets.SetDefaultAssetsPackage(defaultPackage); +YooAssets.SetDefaultAssetsPackage(package); ``` 资源系统的运行模式支持三种:编辑器模拟模式,单机运行模式,联机运行模式。 diff --git a/Docs/CodeTutorial2.md b/Docs/CodeTutorial2.md index e306940..b8f5d60 100644 --- a/Docs/CodeTutorial2.md +++ b/Docs/CodeTutorial2.md @@ -10,7 +10,7 @@ private IEnumerator UpdateStaticVersion() { var package = YooAssets.GetAssetsPackage("DefaultPackage"); - var operation = package.UpdateStaticVersionAsync(); + var operation = package.UpdatePackageVersionAsync(); yield return operation; if (operation.Status == EOperationStatus.Succeed) @@ -35,7 +35,7 @@ private IEnumerator UpdateStaticVersion() private IEnumerator UpdatePatchManifest() { var package = YooAssets.GetAssetsPackage("DefaultPackage"); - var operation = package.UpdateManifestAsync(packageVersion); + var operation = package.UpdatePackageManifestAsync(packageVersion); yield return operation; if (operation.Status == EOperationStatus.Succeed) @@ -119,7 +119,7 @@ IEnumerator Download() private IEnumerator Start() { var package = YooAssets.GetAssetsPackage("DefaultPackage"); - var operation = package.UpdateStaticVersionAsync(30); + var operation = package.UpdatePackageVersionAsync(30); yield return operation; if (operation.Status == EOperationStatus.Succeed) { @@ -149,14 +149,14 @@ private IEnumerator Start() - 编辑器模拟模式 - UpdateStaticVersionAsync()方法和UpdateManifestAsync()方法都不起效,但是都会返回成功! + UpdatePackageVersionAsync()方法和UpdatePackageManifestAsync()方法都不起效,但是都会返回成功! - 单机运行模式 - UpdateStaticVersionAsync()方法和UpdateManifestAsync()方法都不起效,但是都会返回成功! + UpdatePackageVersionAsync()方法和UpdatePackageManifestAsync()方法都不起效,但是都会返回成功! - 联机运行模式 - UpdateManifestAsync()为资源清单更新方法。该方法的内部实现原理如下: + UpdatePackageManifestAsync()为资源清单更新方法。该方法的内部实现原理如下: ![image](./Image/CodeTutorial2-img1.png) diff --git a/Docs/CodeTutorial3.md b/Docs/CodeTutorial3.md index 4445d37..c5e30d2 100644 --- a/Docs/CodeTutorial3.md +++ b/Docs/CodeTutorial3.md @@ -7,7 +7,7 @@ - LoadSubAssetsSync() 同步加载子资源对象 - LoadSubAssetsAsync() 异步加载子资源对象 - LoadSceneAsync() 异步加载场景 -- GetRawFileAsync() 异步获取原生文件 +- LoadRawFileAsync() 异步获取原生文件 **统一约定** @@ -148,11 +148,10 @@ IEnumerator Start() IEnumerator Start() { string location = "Assets/GameRes/wwise/init.bnk"; - string copyPath = $"{Application.persistentDataPath}/Audio/init.bnk"; - RawFileOperation operation = package.GetRawFileAsync(location, copyPath); - yield return operation; - byte[] fileData = operation.GetFileData(); - string fileText = operation.GetFileText(); + RawFileOperationHandle handle = package.LoadRawFileAsync(location); + yield return handle; + byte[] fileData = handle.GetRawFileData(); + string fileText = handle.GetRawFileText(); } ```` diff --git a/Docs/CodeTutorial4.md b/Docs/CodeTutorial4.md index 5147809..d0a91b6 100644 --- a/Docs/CodeTutorial4.md +++ b/Docs/CodeTutorial4.md @@ -81,7 +81,7 @@ IEnumerator Start() // 更新资源包版本 ...... - var operation = package.UpdateManifestAsync(packageCRC); + var operation = package.UpdatePackageManifestAsync(packageCRC); yield return operation; // 下载更新文件