Playground by Górka Mateusz
Goo.Tools.Pooling.AutoObjectPooler Class Reference
+ Inheritance diagram for Goo.Tools.Pooling.AutoObjectPooler:
+ Collaboration diagram for Goo.Tools.Pooling.AutoObjectPooler:

Classes

class  PoolingSet
 

Static Public Member Functions

static T GetObject< T > (GameObject prefab)
 
static GameObject GetObject (GameObject prefab, bool dontCreatePoolerParent=false)
 

Private Attributes

readonly Dictionary< GameObject, PoolingSet_lists = new Dictionary<GameObject, PoolingSet>()
 

Additional Inherited Members

- Static Protected Member Functions inherited from Goo.Tools.Patterns.Singleton< AutoObjectPooler >
static void __NullSingleton ()
 
- Properties inherited from Goo.Tools.Patterns.Singleton< AutoObjectPooler >
static T Instance [get]
 
static bool Initialized [get]
 

Member Function Documentation

◆ GetObject< T >()

static T Goo.Tools.Pooling.AutoObjectPooler.GetObject< T > ( GameObject  prefab)
inlinestatic
29 {
30 return GetObject(prefab).GetComponent<T>();
31 }
static GameObject GetObject(GameObject prefab, bool dontCreatePoolerParent=false)
Definition: AutoObjectPooler.cs:33

◆ GetObject()

static GameObject Goo.Tools.Pooling.AutoObjectPooler.GetObject ( GameObject  prefab,
bool  dontCreatePoolerParent = false 
)
inlinestatic
34 {
35 PoolingSet set;
36 var data = Instance._lists;
37
38 if (!data.TryGetValue(prefab, out set))
39 {
40 set = dontCreatePoolerParent ? new PoolingSet() : new PoolingSet(prefab);
41 data[prefab] = set;
42 }
43
44 GameObject obj = set.List.GetRecycled();
45
46 if (obj == null)
47 {
48 obj = GameObject.Instantiate(prefab, set.Parent);
49 set.List.Add(obj);
50 }
51
52 return obj;
53 }
static T Instance
Definition: Singleton.cs:8

Member Data Documentation

◆ _lists

readonly Dictionary<GameObject, PoolingSet> Goo.Tools.Pooling.AutoObjectPooler._lists = new Dictionary<GameObject, PoolingSet>()
private

The documentation for this class was generated from the following file: