Introduction to Object Pooling in Unity 2022
In Chapter 5, we imported and prepped artwork for use with additional 2D animation tooling, which is bringing the game to life. We also processed player input using an input action map – instead of reading device input directly – with the new Input System, and we made a PlayerController
script to move the player.
We dove deeper into Mecanim as we learned how to transition between animations and drive animation state changes from code.
In this chapter, you will be introduced to object pooling while we use this optimization pattern for the player’s shooting mechanic, and we’ll accomplish that using Unity’s object pooling API. The object pooling software design will be based on a pooled player shooting model UML diagram.
In this chapter, we’re going to cover the following main topics:
- The object pooling pattern
- A pooled player shooting model
By the end of this chapter, you...