Hopefully, we now have an understanding of what we need from our pooling system, so all that's left is to implement it. The requirements are as follows:
- It must accept requests to spawn a GameObject instance from a Prefab, an initial position, and an initial rotation:
- If a despawned version already exists, it should respawn the first available one
- If it does not exist, then it should instantiate a new GameObject instance from the Prefab
- In either case, the Spawned() method should be invoked on all IPoolableComponent interface classes attached to GameObject
- It must accept requests to despawn a specific GameObject instance:
- If the object is managed by the pooling system, it should deactivate it and call the