public ObjectPool(GameObject prefab, int size);
Description
Constructor of ObjectPool
Values
| Value | Description |
|---|---|
| prefab | The GameObject to be created in the Pool |
| size | Number to be generated |
public ObjectPool(GameObject prefab, int size, Transform parent);
Description
Constructor of ObjectPool
Values
| Value | Description |
|---|---|
| prefab | The GameObject to be created in the Pool |
| size | Number to be generated |
| parent | Parent of the pool object |
public void Add(GameObject item);
Description
Add an object to the pool.
Values
| Value | Description |
|---|---|
| item | Objects to add |
public GameObject Peek(bool active = true);
Description
Get the useable objects.
Values
| Value | Description |
|---|---|
| active | Whether the imported object is active |
public int MaxSize { get; private set; }
Description
Pool size