Update document
parent
3bb01ef9a8
commit
4776ab9bd8
|
@ -7,10 +7,10 @@
|
|||
YooAssets.Initialize();
|
||||
|
||||
// 创建默认的资源包
|
||||
var defaultPackage = YooAssets.CreateAssetsPackage("DefaultPackage");
|
||||
var package = YooAssets.CreateAssetsPackage("DefaultPackage");
|
||||
|
||||
// 设置该资源包为默认的资源包,可以使用YooAssets相关加载接口加载该资源包内容。
|
||||
YooAssets.SetDefaultAssetsPackage(defaultPackage);
|
||||
YooAssets.SetDefaultAssetsPackage(package);
|
||||
```
|
||||
|
||||
资源系统的运行模式支持三种:编辑器模拟模式,单机运行模式,联机运行模式。
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
````
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ IEnumerator Start()
|
|||
|
||||
// 更新资源包版本
|
||||
......
|
||||
var operation = package.UpdateManifestAsync(packageCRC);
|
||||
var operation = package.UpdatePackageManifestAsync(packageCRC);
|
||||
yield return operation;
|
||||
|
||||
// 下载更新文件
|
||||
|
|
Loading…
Reference in New Issue