Add A SpawnPool Component
2. Enter the name you want to use to access the pool. If you don't enter a name, PoolManager will use the name of the GameObject (without the word "Pool" if found, so "MyPool" would automatically create a pool named "My" - this only happens when the field is left blank, otherwise the field value will be used as is).
Match Pool Scale
Match Pool Layer
Don't Destroy On Load
Log Messages Option
First, add the namespace 'using' line to the top of the script file, e.g. 'using PathologicalGames;' Then you can access the code in PoolManager to begin integrating it with your project. For example, you would do this with Unity's methods:
With PoolManager, using a pool named "Shapes", you would do this instead:
See the documentation for SpawnPool.Spawn() and SpawnPool..Despawn() for more information and options.
Prefabs versus Instances
To clarify the difference, think of instances as copies, or clones, of a prefab. When you use Spawn() you are telling PoolManager you want a clone, so pass a prefab to Spawn(). When despawning, you are telling an instance you are done with it, so pass an instance to Despawn(). If you pass an instance to Spawn(), you will make a new instance but it will also start a new PrefabPool because it is a copy of something new. |
Documentation >