File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 66using ZBase . Foundation . Pooling ;
77using ZBase . Foundation . Pooling . UnityPools ;
88
9- namespace Project . Runtime
9+ namespace Pooling . Sample
1010{
1111 public class Demo : MonoBehaviour
1212 {
@@ -19,12 +19,15 @@ public class Demo : MonoBehaviour
1919 private StackPool < int > _stackPool ;
2020 private QueuePool < int > _queuePool ;
2121
22+ private ZBase . Collections . Pooled . Generic . List < int > myList ;
23+
2224 [ SerializeField ] private GameObject prefab ;
2325 [ SerializeField ] private RectTransform canvas ;
2426
2527 async void Start ( )
2628 {
2729 this . _listPool = new ListPool < int > ( ) ;
30+
2831 var rentList = this . _listPool . Rent ( ) ;
2932 for ( int i = 0 ; i < 10 ; i ++ )
3033 {
@@ -34,7 +37,9 @@ async void Start()
3437 this . _listPool . Return ( rentList ) ;
3538
3639 this . _hashSetPool = SharedPool . Of < HashSetPool < int > > ( ) ;
40+
3741 var rentHashSet = this . _hashSetPool . Rent ( ) ;
42+
3843 for ( int i = 0 ; i < 10 ; i ++ )
3944 {
4045 rentHashSet . Add ( i ) ;
Original file line number Diff line number Diff line change 11{
2- "name": "Project.Runtime ",
2+ "name": "Pooling.Sample ",
33 "rootNamespace": "Pooling.Sample",
44 "references": [
55 "Unity.TextMeshPro",
You can’t perform that action at this time.
0 commit comments