Breed

Purchase the Plugin from the Unity Asset Store.

There are two classes for the Breed plugin: Breed and BreedPool. Use the Breed class to create, remove, and get the BreedPool object. The BreedPool is what is used to spawn, unspawn, preload, clear, etc. the game object.

// create a pool and return a "BreedPool" object
Breed.Instance().Create(string name, gameObject object)
// ie
Breed.Instance().Create("bullets", bulletPrefab);
 
// remove a pool
Breed.Instance().Remove(string name);
 
// remove ALL pools, use this when loading a new level/scene
Breed.Instance().RemoveAll();
 
// will return a "BreedPool" object
var bp : BreedPool = Breed.Instance().Get(string name);
 
// with the "BreedPool" object
 
// spawn and return the game object
// also will call "SetActiveRecursively" to true
// also will call "SendMessage" calling "OnSpawn" passing the BreedPool object
bp.Spawn(vector3 position, quaternion rotation);
 
// unspawn the game object
// also will call "SetActiveRecursively" to false
// also will call "SendMessage" calling "OnUnspawn"
bp.Unspawn(gameObject object);
 
// preload the number of game objects
bp.Preload(int count);
 
// unspawn all will call "Unspawn" on all the active game objects
bp.UnspawnAll();
 
// will call "UnspawnAll" and clear out all game objects
bp.Clear();
 
// returns an int of the active game objects
bp.GetActiveCount();
 
// returns an int of the available game objects
bp.GetAvailableCount();
 
// returns the original game object used to "Instantiate"
bp.GetObject();<br /><br />