mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-22 00:11:41 +00:00
Add load all asset method.
增加新的资源加载方法:加载资源对象所属资源包里的所有资源。
This commit is contained in:
@@ -130,7 +130,7 @@ namespace YooAsset
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 异步加载场景
|
||||
/// 加载场景
|
||||
/// </summary>
|
||||
public static SceneOperationHandle LoadSceneAsync(string scenePath, LoadSceneMode sceneMode, bool activateOnLoad, int priority)
|
||||
{
|
||||
@@ -161,7 +161,7 @@ namespace YooAsset
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步加载资源对象
|
||||
/// 加载资源对象
|
||||
/// </summary>
|
||||
public static AssetOperationHandle LoadAssetAsync(string assetPath, System.Type assetType)
|
||||
{
|
||||
@@ -179,7 +179,7 @@ namespace YooAsset
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步加载所有子资源对象
|
||||
/// 加载子资源对象
|
||||
/// </summary>
|
||||
public static SubAssetsOperationHandle LoadSubAssetsAsync(string assetPath, System.Type assetType)
|
||||
{
|
||||
@@ -196,6 +196,24 @@ namespace YooAsset
|
||||
return provider.CreateHandle() as SubAssetsOperationHandle;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载资源包里的所有资源对象
|
||||
/// </summary>
|
||||
public static AllAssetsOperationHandle LoadAllAssetsAsync(string assetPath, System.Type assetType)
|
||||
{
|
||||
ProviderBase provider = TryGetProvider(assetPath);
|
||||
if (provider == null)
|
||||
{
|
||||
if (SimulationOnEditor)
|
||||
provider = new DatabaseAllAssetsProvider(assetPath, assetType);
|
||||
else
|
||||
provider = new BundledAllAssetsProvider(assetPath, assetType);
|
||||
provider.InitSpawnDebugInfo();
|
||||
_providers.Add(provider);
|
||||
}
|
||||
return provider.CreateHandle() as AllAssetsOperationHandle;
|
||||
}
|
||||
|
||||
|
||||
internal static void UnloadSubScene(ProviderBase provider)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user