2016-01-11
[public] 56.4K views, 1.21K likes, 7.00 dislikes audio only
Object pooling is an optimisation technique which is extremely helpful for boosting the performance of mobile games. The basic idea is to recycle a pool of objects, rather than continually instantiating and destroying new ones.
UPDATE:
At ~15:16 in the video, the lines copied should preferably be pasted BEFORE the call to OnObjectReuse(), so that when that method is called, the object will already have its correct position/rotation values. This could be important when resetting certain things, for example the velocity of a projectile based on its initial rotation.
Source code:
https://github.com/SebLague/Object-Pooling
Support my videos on Patreon: