diff --git a/Assets/YooAsset/Runtime/AssetSystem/Handles/SubAssetsOperationHandle.cs b/Assets/YooAsset/Runtime/AssetSystem/Handles/SubAssetsOperationHandle.cs index d235cbf..73bc410 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Handles/SubAssetsOperationHandle.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Handles/SubAssetsOperationHandle.cs @@ -86,5 +86,25 @@ namespace YooAsset YooLogger.Warning($"Not found sub asset object : {assetName}"); return null; } + + + /// + /// 获取图集下所有的精灵对象集合 + /// + /// 子资源对象类型 + public TObject[] GetSubAssetObjects() where TObject : UnityEngine.Object + { + List ret = new List(); + if (IsValid == false) + { + return null; + } + + foreach (var e in _provider.AllAssetObjects) + { + ret.Add(e as TObject); + } + return ret.ToArray(); + } } } \ No newline at end of file