Update document

pull/4/head
hevinci 2022-03-24 21:34:34 +08:00
parent e8a7be6957
commit f9ac8ab51b
1 changed files with 1 additions and 9 deletions

View File

@ -37,11 +37,7 @@ void Handle_Completed(AssetOperationHandle handle)
```` ````
````C# ````C#
// 协程加载方式 // 协程加载方式
void Start() IEnumerator Start()
{
this.StartCoroutine(AsyncLoad());
}
IEnumerator AsyncLoad()
{ {
AssetOperationHandle handle = YooAssets.LoadAssetAsync<AudioClip>("Audio/bgMusic.mp3"); AssetOperationHandle handle = YooAssets.LoadAssetAsync<AudioClip>("Audio/bgMusic.mp3");
yield return handle; yield return handle;
@ -51,10 +47,6 @@ IEnumerator AsyncLoad()
````C# ````C#
// Task加载方式 // Task加载方式
async void Start() async void Start()
{
await AsyncLoad();
}
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;