From 316294f449daf8f094c8d122ed9ef586a203d59d Mon Sep 17 00:00:00 2001
From: Allen Jiang <41157121@qq.com>
Date: Fri, 13 May 2022 14:08:36 +0800
Subject: [PATCH] =?UTF-8?q?feat(AssetSystem):=20=E8=8E=B7=E5=8F=96?=
=?UTF-8?q?=E5=9B=BE=E9=9B=86=E4=B8=8B=E6=89=80=E6=9C=89=E7=9A=84=E7=B2=BE?=
=?UTF-8?q?=E7=81=B5=E5=AF=B9=E8=B1=A1=E9=9B=86=E5=90=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Handles/SubAssetsOperationHandle.cs | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
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