Skip to content

Commit

Permalink
异步加载原生文件接口问题修正。
Browse files Browse the repository at this point in the history
异步加载原生文件接口问题修正。
  • Loading branch information
ALEXTANGXIAO committed Oct 4, 2023
1 parent 5f694c2 commit 4c8c37f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -587,14 +587,13 @@ public async UniTask<GameObject> LoadGameObjectAsync(string location, Transform
/// <param name="location">资源定位地址。</param>
/// <param name="cancellationToken">取消操作Token。</param>
/// <returns>原生文件资源实例操作句柄。</returns>
/// <remarks>需要自行释放资源句柄(RawFileOperationHandle)。</remarks>
public async UniTask<RawFileOperationHandle> LoadRawAssetAsync(string location, CancellationToken cancellationToken)
{
RawFileOperationHandle handle = YooAssets.LoadRawFileAsync(location);

bool cancelOrFailed = await handle.ToUniTask().AttachExternalCancellation(cancellationToken).SuppressCancellationThrow();

handle.Dispose();

return cancelOrFailed ? null : handle;
}

Expand Down

0 comments on commit 4c8c37f

Please sign in to comment.