Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
PoolManager.PoolGroup Class Reference

Public Member Functions

 PoolGroup (Transform original, PoolManager manager, string _id)
 
Transform Spawn (Transform parent)
 
void Despawn (Transform trans)
 

Public Attributes

string id
 
Transform original
 
Transform holder
 
List< Transform > pooledList = new List<Transform>()
 

Detailed Description

Definition at line 6 of file PoolManager.cs.

Constructor & Destructor Documentation

◆ PoolGroup()

PoolManager.PoolGroup.PoolGroup ( Transform  original,
PoolManager  manager,
string  _id 
)
inline

Definition at line 16 of file PoolManager.cs.

17 {
18 id = _id;
19 this.original = original;
20 holder = new GameObject().transform;
21 holder.SetParent(manager.transform);
22 holder.name = id;
23 }

References PoolManager.PoolGroup.holder, PoolManager.PoolGroup.id, and PoolManager.PoolGroup.original.

Member Function Documentation

◆ Despawn()

void PoolManager.PoolGroup.Despawn ( Transform  trans)
inline

Definition at line 50 of file PoolManager.cs.

51 {
52 trans.SetParent(holder, worldPositionStays: false);
53 pooledList.Add(trans);
54 }
List< Transform > pooledList
Definition: PoolManager.cs:14

References PoolManager.PoolGroup.holder, and PoolManager.PoolGroup.pooledList.

Referenced by PoolManager.TryDespawn().

◆ Spawn()

Transform PoolManager.PoolGroup.Spawn ( Transform  parent)
inline

Definition at line 25 of file PoolManager.cs.

26 {
27 Transform transform = null;
28 if (ignorePool)
29 {
30 transform = Object.Instantiate(original);
31 }
32 else if (pooledList.Count != 0)
33 {
34 transform = pooledList[pooledList.Count - 1];
35 pooledList.RemoveAt(pooledList.Count - 1);
36 }
37 else
38 {
39 transform = Object.Instantiate(original);
40 current.spawnedList[transform.GetHashCode()] = this;
41 }
42 if (Application.isEditor)
43 {
44 transform.SetAsLastSibling();
45 }
46 transform.SetParent(parent, worldPositionStays: false);
47 return transform;
48 }
static PoolManager current
Definition: PoolManager.cs:57
Dictionary< int, PoolGroup > spawnedList
Definition: PoolManager.cs:65
static bool ignorePool
Definition: PoolManager.cs:61

References PoolManager.current, PoolManager.ignorePool, PoolManager.PoolGroup.original, PoolManager.PoolGroup.pooledList, and PoolManager.spawnedList.

Referenced by PoolManager._Spawn().

Member Data Documentation

◆ holder

Transform PoolManager.PoolGroup.holder

◆ id

string PoolManager.PoolGroup.id

Definition at line 8 of file PoolManager.cs.

Referenced by PoolManager.PoolGroup.PoolGroup().

◆ original

Transform PoolManager.PoolGroup.original

Definition at line 10 of file PoolManager.cs.

Referenced by PoolManager.PoolGroup.PoolGroup(), and PoolManager.PoolGroup.Spawn().

◆ pooledList

List<Transform> PoolManager.PoolGroup.pooledList = new List<Transform>()

Definition at line 14 of file PoolManager.cs.

Referenced by PoolManager.PoolGroup.Despawn(), and PoolManager.PoolGroup.Spawn().


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