We are in the process of making Pool Everything. Garbage collecting is a thing of the past. Pooling everything is the best so your game runs smoothly and not bog down the memory.
Some Already Implemented Features:
No coding required or necessary
Simple pooling with component based managers
Time Spawner
Click Spawner
Recycle all objects without having to write code
Time Recycler
Distance Recycler
Value Recycler which you can select public fields available on any script on your game object like the health value, for instance, to be monitored by the Value Recycler for recycling.
Spawners are components which can be put on any game object in the scene. Select a Pool Manager from the drop down, select a pool object from a drop down in that manager and the Spawner will spawn that object.
Recylers are components which can be added to any GameObject in the scene.
Select a Pool Manager from the drop down, select a pool object from a drop down in that manager and the Recyler will recycle that object.
In Process:
Method Spawner - items, bullets, etc. can be spawned from methods already on GameObjects like your ship. The method you already use to fire your weapon can be picked from a drop down and used to spawn a bullet, for instance.
Key press to spawn
Let us know what your think, we are open for suggestions!
Input Key Spawner (concrete) - Allows for KeyCode access for Input GetKey functions
Input Touch Spawner - Detection of touch specific inputs to spawn pooled objects.
Value Recycler - Now used to recycle depending on pooled objects field and property values
Conditional Recycler - Replaces the functionality of the Value Recycler with the addition of property accessibility, like the Conditional Spawner any scene view GameObject can be monitored.
Collider Recycler (abstract)
Trigger Recycler (concrete) - Recycles a pooled object when it’s collider interacts with another trigger collider (all trigger events can be monitored)
Collision Recycler (concrete) - Recycles a pooled object when a collision interaction with another collision collider (all collision events can be monitored)
The following sequence montage show a complete cycle of Pool Everything Spawner/Recycler with actions that execute modifications on runtime GameObjects and their components.
The Spawner, in this case an Input Button Spawner, spawns a cylinder clone when the Input ‘Fire1’ Button is pressed.
The Recycler, a Collision Recycler in this case, monitors the cylinder clones for a collision event. Here it checks for a ‘Stay’ collision event on a collider with the tag Respawn, the floor plane.
This Recycler also modifies the Directional light, on each collision event -0.2 will be removed from the intensity value.
All values are dynamic, depending on the Target, fields, properties and in some cases methods can be invoked.
The Conditional Spawner attached checks for a condition in the game to spawn a pooled object.
Here the Directional light’s intensity level is checked for a value that is less than 0.3 and in turn a cube prefab is spawned.
This took 2 clicks because each cylinder took -0.2 from the intensity level
Watch it in action!
NOTE: All Pool Everything components can be placed on any scene view GameObject and perform as expected. This allows for grouping them in the hierarchy to keep things organized and clean.
In Process:
Method Spawner - Has proven to be a difficult nut to crack and remains a work in progress that does not work :(, requiring IL or AOP implementation or .NET framework beyond 3.5 Unity’s target assembly. (However along the path to finding a nut cracker, enough knowledge was gained to implemented most of the features listed above.)
Let us know what your think, we are open for suggestions!