Add load all asset method.

增加新的资源加载方法:加载资源对象所属资源包里的所有资源。
This commit is contained in:
hevinci
2022-05-06 23:15:03 +08:00
parent 65875b66c2
commit afc08d4e46
18 changed files with 605 additions and 112 deletions

View File

@@ -140,6 +140,8 @@ namespace YooAsset
handle = new SceneOperationHandle(this);
else if (IsSubAssetsProvider())
handle = new SubAssetsOperationHandle(this);
else if (IsAllAssetsProvider())
handle = new AllAssetsOperationHandle(this);
else
handle = new AssetOperationHandle(this);
@@ -162,28 +164,6 @@ namespace YooAsset
RefCount--;
}
/// <summary>
/// 是否为场景提供者
/// </summary>
public bool IsSceneProvider()
{
if (this is BundledSceneProvider || this is DatabaseSceneProvider)
return true;
else
return false;
}
/// <summary>
/// 是否为子资源对象提供者
/// </summary>
public bool IsSubAssetsProvider()
{
if (this is BundledSubAssetsProvider || this is DatabaseSubAssetsProvider)
return true;
else
return false;
}
/// <summary>
/// 等待异步执行完毕
/// </summary>
@@ -218,6 +198,28 @@ namespace YooAsset
}
}
public bool IsSceneProvider()
{
if (this is BundledSceneProvider || this is DatabaseSceneProvider)
return true;
else
return false;
}
public bool IsSubAssetsProvider()
{
if (this is BundledSubAssetsProvider || this is DatabaseSubAssetsProvider)
return true;
else
return false;
}
public bool IsAllAssetsProvider()
{
if (this is BundledAllAssetsProvider || this is DatabaseAllAssetsProvider)
return true;
else
return false;
}
#region
private TaskCompletionSource<object> _taskCompletionSource;
protected void InvokeCompletion()