In Unity, when you deal with amounts of objects, eg. bullets, we need to reuse thoese useless objects to optimize memory-allocs .
Then we can use the "Pool", whick can cache those invalid objects for the using of next time.
It is a Unity plug-in, whick help to create and reuse objects quickly and conveniently. It is the quick ojects pool.
★ Pool lots of gameObjects or anything else
★ Very effective to create and reuse objects
★ The code is clear and easy to read
★ Very simple to use, learn in 1 minutes.
Support Mail: firstname.lastname@example.org
My Blog: http://blog.csdn.net/andrewfan
Version 1.0.0 2017.10.16
Pool Anything v1.0.0
Before you use Pool, you need to create the GameObject Templates,whick are used to create dumplicate GameObjects from them. You need to create a gameObject with BAT_PoolSetting. Then you can set the number of templates and assign some GameObjects (prefab is better) to the templates. Once the gameObject becomes template, then BAT_PoolSetting will mark the gameObjects's name as the name of template.
The Spawner is a point that can spawn objects by name and rate. You need to create a gameObject with BAT_TimeSpawner, then set the name of gameobect which to spwan, the name must be the name one of the GameObject Templates.
Spwan by your self
That's it.If everything is set correctly,nosw the Pool is woking.
If you need to spwan by your self,just call:
BAT_Spawner swapner; swapner.spawnGameObject();
BAT_PoolAnything is internal implimentation.
Usually, you don't need to Create BAT_PoolAnything, because it would be create automatically when it is needed, it is the holder of all Objects ,it just is the 【Pool】.
You still could Create another BAT_PoolAnything with a pool name if you need.
The working gameObjects and idle gameObjects
When gameObject is valid , it would be set to the child of PoolMaster/work.
When gameObject is invalid , it would be set to the child of PoolMaster/idle.
Create your own Spwaner by extending class from BAT_Spawner.