💦 CREATE AND FUCK YOUR OWN AI CUMSLUT 🔥 TRY NOW ♥
Create AI Cumsluts 💦
September 25, 2015

Object Pools

http://catlikecoding.com/unity/tutorials/object-pools/

Object Pools. What are they, how do they work, and are they useful? I tried to answer these questions, using a fountain of stuff and a simple object pooling approach that is easy to use.

Comments (4)

p
praveen reddy k v · September 4, 2016

Hi Jasper, for switching scene code in Object pools. If attach script directly in the button on-click It does't show the function . If I attach to gameObject and then its working fine. I am just curious how its working for you

C
Catlike Coding · September 6, 2016

The game object that you assign to the event must have the SceneSwitcher component on it. Then you can select the SwitchScene method. It doesn't matter whether you put the component on the button object, or use a separate object. But you have to assign the correct object to the event.

C
Cam N · March 20, 2016

Hi Jasper! Would you mind explaining why we use a struct in Part 2: Adding Variation and what they're useful for?

C
Catlike Coding · March 21, 2016

You mean FloatRange? It's both for convenience and grouping. Instead of adding two logically linked but separate float fields - timeBetweenSpawnsMin and timeBetweenSpawnsMax - you add one range field. It also contains the RandomInRange functionality. It's just like you use Vector3 everywhere, instead of storing separate X, Y, and Z floats, and then don't know where to put the vector manipulation methods.