@@ -7,7 +7,7 @@ namespace ToolBox.Pools
77 [ System . Serializable ]
88 public class Pool
99 {
10- [ SerializeField , AssetsOnly , TabGroup ( "Data" ) ] private Poolable prefab = null ;
10+ [ SerializeField , AssetsOnly , TabGroup ( "Data" ) , AssetSelector ] private Poolable prefab = null ;
1111 [ SerializeField , TabGroup ( "Data" ) ] private int startCount = 0 ;
1212 [ SerializeField , TabGroup ( "Data" ) ] private bool isResizable = false ;
1313 [ SerializeField , SceneObjectsOnly , TabGroup ( "Data" ) ] private Transform holder = null ;
@@ -98,6 +98,18 @@ public Poolable GetEntity(Vector3 position, Quaternion rotation, Transform paren
9898 return entity ;
9999 }
100100
101+ public T GetEntity < T > ( ) where T : Component =>
102+ GetEntity ( ) . Component as T ;
103+
104+ public T GetEntity < T > ( Transform parent , bool spawnInWorldSpace ) where T : Component =>
105+ GetEntity ( parent , spawnInWorldSpace ) . Component as T ;
106+
107+ public T GetEntity < T > ( Vector3 position , Quaternion rotation ) where T : Component =>
108+ GetEntity ( position , rotation ) . Component as T ;
109+
110+ public T GetEntity < T > ( Vector3 position , Quaternion rotation , Transform parent , bool spawnInWorldSpace ) where T : Component =>
111+ GetEntity ( position , rotation , parent , spawnInWorldSpace ) . Component as T ;
112+
101113 public void ReturnEntity ( Poolable entity )
102114 {
103115 if ( entity . Pool != this )
0 commit comments