12-02-2021, 11:56 PM
It is a bit complicated:
I am assuming that you are using the Create GameObject module to create the sleepers. In that case, your module uses in play mode a pool to reuse instances of your sleepers, for performance reasons. The deleted sleepers are pushed, again in play mode, to the pool. Before pushing them, it calls the IPoolable.OnBeforePush if any. So add to your sleepers a script that implements the IPoolable interface, and put your behaviour in the OnBeforePush method.
Did this help?
I am assuming that you are using the Create GameObject module to create the sleepers. In that case, your module uses in play mode a pool to reuse instances of your sleepers, for performance reasons. The deleted sleepers are pushed, again in play mode, to the pool. Before pushing them, it calls the IPoolable.OnBeforePush if any. So add to your sleepers a script that implements the IPoolable interface, and put your behaviour in the OnBeforePush method.
Did this help?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.