PooledObject Pro

PooledObject Pro is a C# scripting package intended for Unity3D. It helps improve the ability and efficiency of handling large groups of duplicate objects, has multiple custom features for interacting with these groups of objects, and much more! Use this to more efficiently handle your large amounts of duplicate objects. Its features include: The Spawn function: Use this function to create or pull from the pool an object of template objectName.
The Create function: Use this function to forcefully create an object of template objectName even if there's one available in the pool.
The Launch function: Use this function to pull from the pool an object of template objectName. Will not create a new TBPooledObject if there are none available.
The Closest/Farthest funtions: Use these functions to check for the nearest/furthest TBPooledObject of any template listed in toTargetOfTemplateNames parameter.
The Kill function: Use this function to "Destroy" a TBPooledObject and return it to the pool.
The Discard function: Use this function to safely remove a TBPooledObject derived script so that the object then behaves normally again.
The Annihilate function: Use this function to safely and literally DESTROY a TBPooledObject.
The SafeSceneChange function: Use this function to exempt any passive and active TBPooledObjects from destruction on scene change. (Use this if you'd like to preserve your pools as you change scenes, so that you don't have to re-instantiate objects in your new scene).
The Init function: Use this to mark a target GameObject as a template during runtime. This is useful for when you want to create a template of an object only when that object meets a criteria, and you don't know what those criteria will be in compiletime.
The QOL functions. Use these to help you debug your project. You can use them to log the members or template data in runtime.
More features coming!

You can purchase the asset here, and if you encounter any bugs, you can get in contact with the developer though this email.

Screenshots & visual info

Pooling/Reusing

(Field highlighted in red). Look at how consistent and low the peaks are for GC Allocated, and see how far the garbage collections are apart! (Yellow-orange line).

Instantiation/Destruction

(Field highlighted in red). Look at how inconsistent and often the memory GC Allocated Spikes! This can cause increased memory use and random CPU performance drops.

How to use PooledObject Pro

NOTE: Know that it is safe to delete the “Demo” folder at the directory “TB - PooledObject Pro > Demo” and it is safe and recommended to delete the “DemoCube” prefab at the directory “TB - PooledObject Pro > Resources > POTemplates > DemoCube” once you have decided you don’t need the demo anymore.

This portion of the tutorial is in-depth, so if you’re looking for a quick start, scroll down to the Quick Start section below.

*In-Depth tutorial still in progress*

Quick Start

First of all, to get our object pooling system working, we need to designate some TBPooledObject Prefabs. To do this, we need to create some prefabs by dragging them into our project directory; in the “TB - PooledObject Pro > Resources > POTemplates” folder. (Make sure your prefab has a TBPooledObject derived script on it. (If you don’t know what that means, just change the “MonoBehaviour” at the top of the class to “TBPooledObject”).). Now that that is done, we need to figure out the ways to use the TBPooledOBject functions to begin using our object pool. Listed below are the ways to “Create”, “Destroy”, and do basic general interactions with our pooled objects.