From e2788839586876da483729377580aa5cb8d06408 Mon Sep 17 00:00:00 2001 From: hevinci Date: Thu, 30 Mar 2023 17:41:42 +0800 Subject: [PATCH] update docs --- Docs/AssetBundleBuilder.md | 8 ++++---- Docs/AssetBundleCollector.md | 7 +++---- Docs/AssetBundleDeployer.md | 12 ++++++------ Docs/CodeTutorial1.md | 10 +++++----- Docs/CodeTutorial2.md | 22 +++++++++++----------- Docs/CodeTutorial3.md | 3 +-- Docs/CodeTutorial4.md | 6 +++--- Docs/GlobalSettings.md | 2 +- README.md | 2 +- 9 files changed, 35 insertions(+), 37 deletions(-) diff --git a/Docs/AssetBundleBuilder.md b/Docs/AssetBundleBuilder.md index 219d5a1..f586eaf 100644 --- a/Docs/AssetBundleBuilder.md +++ b/Docs/AssetBundleBuilder.md @@ -80,17 +80,17 @@ ### 补丁清单 -补丁清单文件是上图中以PatchManifest开头命名的文件。 +补丁清单文件是上图中以PackageManifest开头命名的文件。 -- PatchManifest_DefaultPackage_xxxxxx.hash +- PackageManifest_DefaultPackage_xxxxxx.hash 记录了补丁清单文件的哈希值。 -- PatchManifest_DefaultPackage_xxxxxx.json +- PackageManifest_DefaultPackage_xxxxxx.json 该文件为Json文本格式,主要用于开发者预览信息。 -- PatchManifest_DefaultPackage_xxxxxx.bytes +- PackageManifest_DefaultPackage_xxxxxx.bytes 该文件为二进制格式,主要用于程序内读取加载。 diff --git a/Docs/AssetBundleCollector.md b/Docs/AssetBundleCollector.md index 6f9ff36..1a95d07 100644 --- a/Docs/AssetBundleCollector.md +++ b/Docs/AssetBundleCollector.md @@ -90,11 +90,10 @@ 可寻址规则,规则可以自定义扩展。下面是内置规则: - AddressByFileName 以文件名为定位地址。 - + - AddressByFilePath 以文件路径为定位地址。 - AddressByGrouperAndFileName 以分组名+文件名为定位地址。 - - AddressByFolderAndFileName 以文件夹名+文件名为定位地址。 - + ````c# //自定义扩展范例 public class AddressByFileName : IAddressRule @@ -105,7 +104,7 @@ } } ```` - + - **PackRule** 打包规则,规则可以自定义扩展。下面是内置规则: diff --git a/Docs/AssetBundleDeployer.md b/Docs/AssetBundleDeployer.md index 8357dd2..47d91d9 100644 --- a/Docs/AssetBundleDeployer.md +++ b/Docs/AssetBundleDeployer.md @@ -26,15 +26,15 @@ v1.0 代表的是APP版本,不是资源版本。在没有更换安装包的情 例如:我们游戏的当前APP版本是v1.0,那么每次生成的补丁文件全部覆盖到v1.0的目录下即可。 -下面的示例里一共上传过2次补丁包。第二次上传的补丁包会把第一次的版本记录文件(PatchManifest_DefaultPackage.version)覆盖掉。当我们想回退资源版本的时候,把第一次生成的版本记录文件覆盖到同目录下即可。 +下面的示例里一共上传过2次补丁包。第二次上传的补丁包会把第一次的版本记录文件(PackageManifest_DefaultPackage.version)覆盖掉。当我们想回退资源版本的时候,把第一次生成的版本记录文件覆盖到同目录下即可。 ```` v1.0(游戏版本) -├─PatchManifest_DefaultPackage.version -├─PatchManifest_DefaultPackage_2023-02-01-654.hash -├─PatchManifest_DefaultPackage_2023-02-01-654.bytes -├─PatchManifest_DefaultPackage_2023-02-12-789.hash -├─PatchManifest_DefaultPackage_2023-02-12-789.bytes +├─PackageManifest_DefaultPackage.version +├─PackageManifest_DefaultPackage_2023-02-01-654.hash +├─PackageManifest_DefaultPackage_2023-02-01-654.bytes +├─PackageManifest_DefaultPackage_2023-02-12-789.hash +├─PackageManifest_DefaultPackage_2023-02-12-789.bytes ├─2bb5a28d37dabf27df8bc6a4706b8f80.bundle ├─2dbea9c3056c8839bc03d80a2aebd105.bundle ├─6e8c3003a64ead36a0bd2d5cdebfbcf4.bundle diff --git a/Docs/CodeTutorial1.md b/Docs/CodeTutorial1.md index 54d4921..e8385aa 100644 --- a/Docs/CodeTutorial1.md +++ b/Docs/CodeTutorial1.md @@ -7,10 +7,10 @@ YooAssets.Initialize(); // 创建默认的资源包 -var package = YooAssets.CreateAssetsPackage("DefaultPackage"); +var package = YooAssets.CreatePackage("DefaultPackage"); // 设置该资源包为默认的资源包,可以使用YooAssets相关加载接口加载该资源包内容。 -YooAssets.SetDefaultAssetsPackage(package); +YooAssets.SetDefaultPackage(package); ``` 资源系统的运行模式支持三种:编辑器模拟模式,单机运行模式,联机运行模式。 @@ -26,7 +26,7 @@ private IEnumerator InitializeYooAsset() { var initParameters = new EditorSimulateModeParameters(); initParameters.SimulatePatchManifestPath = EditorSimulateModeHelper.SimulateBuild("DefaultPackage"); - yield return defaultPackage.InitializeAsync(initParameters); + yield return package.InitializeAsync(initParameters); } ```` @@ -40,7 +40,7 @@ private IEnumerator InitializeYooAsset() private IEnumerator InitializeYooAsset() { var initParameters = new OfflinePlayModeParameters(); - yield return defaultPackage.InitializeAsync(initParameters); + yield return package.InitializeAsync(initParameters); } ```` @@ -65,7 +65,7 @@ private IEnumerator InitializeYooAsset() initParameters.QueryServices = new QueryStreamingAssetsFileServices(); initParameters.DefaultHostServer = "http://127.0.0.1/CDN1/Android/v1.0"; initParameters.FallbackHostServer = "http://127.0.0.1/CDN2/Android/v1.0"; - yield return defaultPackage.InitializeAsync(initParameters); + yield return package.InitializeAsync(initParameters); } // 内置文件查询服务类 diff --git a/Docs/CodeTutorial2.md b/Docs/CodeTutorial2.md index e1dc220..bfedb2b 100644 --- a/Docs/CodeTutorial2.md +++ b/Docs/CodeTutorial2.md @@ -7,9 +7,9 @@ 该资源版本可以通过YooAssets提供的接口来更新,也可以通过HTTP访问游戏服务器来获取。 ````c# -private IEnumerator UpdateStaticVersion() +private IEnumerator UpdatePackageVersion() { - var package = YooAssets.GetAssetsPackage("DefaultPackage"); + var package = YooAssets.GetPackage("DefaultPackage"); var operation = package.UpdatePackageVersionAsync(); yield return operation; @@ -32,9 +32,9 @@ private IEnumerator UpdateStaticVersion() 对于联机运行模式,在获取到资源版本号之后,就可以更新资源清单了。 ````c# -private IEnumerator UpdatePatchManifest() +private IEnumerator UpdatePackageManifest() { - var package = YooAssets.GetAssetsPackage("DefaultPackage"); + var package = YooAssets.GetPackage("DefaultPackage"); var operation = package.UpdatePackageManifestAsync(packageVersion); yield return operation; @@ -58,11 +58,11 @@ private IEnumerator UpdatePatchManifest() 补丁包下载接口: -- YooAssets.CreatePatchDownloader(int downloadingMaxNumber, int failedTryAgain, int timeout) +- YooAssets.CreateResourceDownloader(int downloadingMaxNumber, int failedTryAgain, int timeout) 用于下载更新当前资源版本所有的资源包文件。 -- YooAssets.CreatePatchDownloader(string[] tags, int downloadingMaxNumber, int failedTryAgain, int timeout) +- YooAssets.CreateResourceDownloader(string[] tags, int downloadingMaxNumber, int failedTryAgain, int timeout) 用于下载更新资源标签指定的资源包文件。 @@ -76,8 +76,8 @@ IEnumerator Download() int downloadingMaxNum = 10; int failedTryAgain = 3; int timeout = 60; - var package = YooAssets.GetAssetsPackage("DefaultPackage"); - var downloader = package.CreatePatchDownloader(downloadingMaxNum, failedTryAgain, timeout); + var package = YooAssets.GetPackage("DefaultPackage"); + var downloader = package.CreateResourceDownloader(downloadingMaxNum, failedTryAgain, timeout); //没有需要下载的资源 if (downloader.TotalDownloadCount == 0) @@ -118,7 +118,7 @@ IEnumerator Download() ````c# private IEnumerator Start() { - var package = YooAssets.GetAssetsPackage("DefaultPackage"); + var package = YooAssets.GetPackage("DefaultPackage"); var operation = package.UpdatePackageVersionAsync(30); yield return operation; if (operation.Status == EOperationStatus.Succeed) @@ -131,7 +131,7 @@ private IEnumerator Start() // 如果获取远端资源版本失败,说明当前网络无连接。 // 在正常开始游戏之前,需要验证本地清单内容的完整性。 string packageVersion = package.GetPackageVersion(); - var operation = package.PreDownloadPackageAsync(packageVersion); + var operation = package.PreDownloadContentAsync(packageVersion); yield return operation; if (operation.Status != EOperationStatus.Succeed) { @@ -142,7 +142,7 @@ private IEnumerator Start() int downloadingMaxNum = 10; int failedTryAgain = 3; int timeout = 60; - var downloader = operation.CreatePatchDownloader(downloadingMaxNum, failedTryAgain, timeout); + var downloader = operation.CreateResourceDownloader(downloadingMaxNum, failedTryAgain, timeout); if (downloader.TotalDownloadCount > 0) { // 资源内容本地并不完整,需要提示玩家联网更新。 diff --git a/Docs/CodeTutorial3.md b/Docs/CodeTutorial3.md index 5c7b699..b25bc9a 100644 --- a/Docs/CodeTutorial3.md +++ b/Docs/CodeTutorial3.md @@ -2,12 +2,11 @@ **加载方法** +- LoadSceneAsync() 异步加载场景 - LoadAssetSync() 同步加载资源对象 - LoadAssetAsync() 异步加载资源对象 - LoadSubAssetsSync() 同步加载子资源对象 - LoadSubAssetsAsync() 异步加载子资源对象 -- LoadSceneSync() 同步加载场景 -- LoadSceneAsync() 异步加载场景 - LoadRawFileSync() 同步获取原生文件 - LoadRawFileAsync() 异步获取原生文件 diff --git a/Docs/CodeTutorial4.md b/Docs/CodeTutorial4.md index fddd3e1..dcfc470 100644 --- a/Docs/CodeTutorial4.md +++ b/Docs/CodeTutorial4.md @@ -13,8 +13,8 @@ private object LoadFunc(string name, string extension, System.Type type, out Des { method = DestroyMethod.None; //注意:这里一定要设置为None string location = $"Assets/FairyRes/{name}{extension}"; - var assetPackage = YooAssets.GetAssetsPackage("DefaultPackage"); - var handle = assetPackage.LoadAssetSync(location , type); + var package = YooAssets.GetPackage("DefaultPackage"); + var handle = package.LoadAssetSync(location , type); _handles.Add(handle); return handle.AssetObject; } @@ -54,7 +54,7 @@ IEnumerator Start() YooAssets.Initialize(); // 创建资源包实例 - var package = YooAssets.CreateAssetPackage("DefaultPackage"); + var package = YooAssets.CreatePackage("DefaultPackage"); // 初始化资源包 ...... diff --git a/Docs/GlobalSettings.md b/Docs/GlobalSettings.md index 43e4f5c..481a41e 100644 --- a/Docs/GlobalSettings.md +++ b/Docs/GlobalSettings.md @@ -8,5 +8,5 @@ 配置说明: -- **Patch Manifest File Name** : 补丁清单文件名称 +- **Manifest File Name** : 补丁清单文件名称 diff --git a/README.md b/README.md index 7cd5610..8ceea96 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ YooAsset可以满足以下任何需求: - **支持可寻址资源定位** - 默认支持相对路径的资源定位,也支持可寻址资源定位,不需要繁琐的过程即可高效的配置寻址路径。 + 默认支持完整路径的资源定位,也支持可寻址资源定位,不需要繁琐的过程即可高效的配置寻址路径。 - **安全高效的分包方案**