Skip to content

densylkin/QuickPool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity-QuickPool

You can use quickpool in two ways:

  • Create PoolManager and configure your pools with editor

Imgur

  • Or create a Pool field (in this case you will need to register your pool somewhere in Start with PoolManager.RegisterPool())

Imgur

Include QuickPool namespace

using QuickPool;

You can use extention methods

var instance = somePrefab.Spawn(Vector3.zero, Quaternion.identity);
var component = somePrefab.Spawn<Component>(Vector3.zero, Quaternion.identity);
obj.Despawn();

You also can get concrete pool from PoolManager or use that one you have created

public Pool pool = new Pool()
{
  size = 100,
  allowGrowth = true
};

// OR

var pool = PoolManager.Instance["pool name"];
private void Start()
{
  PoolsManager.RegisterPool(pool); //register pool if you want to use extention method Despawn
  pool.Initialize(); 
  
  var instance = pool.Spawn(Vector3.zero, Quaternion.identity);
  var conponent = pool.Spawn<Component>(Vector3.zero, Quaternion.identity);
  pool.Despawn(instance);
}

Despawn all spawned objects

PoolsManager.DespawnAll();
// OR
pool.DespawnAll();

About

Simple pooling toolkit for Unity game engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages