Skip to content

Commit 0c29114

Browse files
authored
Update README.md
1 parent 032b6af commit 0c29114

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ Also, you can just put PoolInstaller component on any object on Scene and select
4444

4545
![](https://i.imgur.com/gnyZ0RQ.png)
4646

47+
### How to clear pool and it's instances
48+
```csharp
49+
using ToolBox.Pools;
50+
using UnityEngine;
51+
52+
public class Spawner : MonoBehaviour
53+
{
54+
[SerializeField] private GameObject _prefab = null;
55+
56+
private void Awake()
57+
{
58+
_prefab.Populate(count: 50);
59+
60+
// If destroy active is true then even active instances will be destroyed
61+
_prefab.Clear(destroyActive: true)
62+
}
63+
}
64+
```
65+
4766
### How to get object from pool:
4867
```csharp
4968
using ToolBox.Pools;

0 commit comments

Comments
 (0)