PoolManager offers two optional events which you can use to manage the state of your instances as they spawn and despawn. All you have to do to use these events is add a function with the same name to your script, just like you would do to use Unity's Start(). To see a good example of what these look like in a script, and how they might be used, see the Example Pattern: Projectile Self-Destruct. Added in PoolManager 5.5.1... There is now an example script showing these in action. The script is attached to the audio pool in the audio example scene as well. OnDespawned and OnSpawned now have an optional argument: A reference to the SpawnPool which triggered the event. To ignore this argument, simply do not use it. OnSpawned() |
Code Reference >