Skip to content

Commit

Permalink
Fixed tuyoogame#25
Browse files Browse the repository at this point in the history
修复了资源文件不存在返回的handle无法完成的问题。
  • Loading branch information
gmhevinci committed Jul 20, 2022
1 parent 2cb9278 commit 86142ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ public static SceneOperationHandle LoadSceneAsync(AssetInfo assetInfo, LoadScene
{
if (assetInfo.IsInvalid)
{
YooLogger.Warning(assetInfo.Error);
CompletedProvider completedProvider = new CompletedProvider(assetInfo);
completedProvider.SetCompleted();
return completedProvider.CreateHandle<SceneOperationHandle>();
}

Expand Down Expand Up @@ -178,8 +178,8 @@ public static AssetOperationHandle LoadAssetAsync(AssetInfo assetInfo)
{
if (assetInfo.IsInvalid)
{
YooLogger.Warning(assetInfo.Error);
CompletedProvider completedProvider = new CompletedProvider(assetInfo);
completedProvider.SetCompleted();
return completedProvider.CreateHandle<AssetOperationHandle>();
}

Expand All @@ -203,8 +203,8 @@ public static SubAssetsOperationHandle LoadSubAssetsAsync(AssetInfo assetInfo)
{
if (assetInfo.IsInvalid)
{
YooLogger.Warning(assetInfo.Error);
CompletedProvider completedProvider = new CompletedProvider(assetInfo);
completedProvider.SetCompleted();
return completedProvider.CreateHandle<SubAssetsOperationHandle>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public CompletedProvider(AssetInfo assetInfo) : base(assetInfo)
}
public override void Update()
{
if (IsDone)
return;

}
public void SetCompleted()
{
if (Status == EStatus.None)
{
Status = EStatus.Fail;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ public bool IsSceneProvider()
/// <summary>
/// 创建操作句柄
/// </summary>
/// <returns></returns>
public T CreateHandle<T>() where T : OperationHandleBase
{
// 引用计数增加
Expand Down

0 comments on commit 86142ed

Please sign in to comment.