diff --git a/Assets/YooAsset/Samples~/UniTask Sample/README.md b/Assets/YooAsset/Samples~/UniTask Sample/README.md index af26581..521c206 100644 --- a/Assets/YooAsset/Samples~/UniTask Sample/README.md +++ b/Assets/YooAsset/Samples~/UniTask Sample/README.md @@ -8,13 +8,16 @@ ## 代码示例 ```csharp -var handle = YooAssets.LoadAssetAsync("Assets/Res/Prefabs/TestImg.prefab"); +public async UniTask Example(IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update) +{ + var handle = YooAssets.LoadAssetAsync("Assets/Res/Prefabs/ TestImg.prefab"); -await handle.ToUniTask(); + await handle.ToUniTask(progress, timing); -var obj = handle.AssetObject as GameObject; -var go = Instantiate(obj, transform); + var obj = handle.AssetObject as GameObject; + var go = Instantiate(obj, transform); -go.transform.localPosition = Vector3.zero; -go.transform.localScale = Vector3.one; + go.transform.localPosition = Vector3.zero; + go.transform.localScale = Vector3.one; +} ``` \ No newline at end of file