|
static T | GetObject< T > (GameObject prefab) |
|
static GameObject | GetObject (GameObject prefab, bool dontCreatePoolerParent=false) |
|
◆ GetObject< T >()
29 {
30 return GetObject(prefab).GetComponent<T>();
31 }
◆ GetObject()
static GameObject Goo.Tools.Pooling.AutoObjectPooler.GetObject |
( |
GameObject |
prefab, |
|
|
bool |
dontCreatePoolerParent = false |
|
) |
| |
|
inlinestatic |
34 {
35 PoolingSet set;
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 }
◆ _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: