Skip to content

A small, simple and easy to use pooling system for Unity

Notifications You must be signed in to change notification settings

lensisle/tiny-pool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

TinyPool

Using TinyPool is very easy.

Initialize:

TinyPool.Initialize();

Create a Pool:

TinyPool.CreatePool((GameObject)Prefab, 
                    (string)PoolID, 
                    (int)InitialPoolSize, 
                    (int)maxPoolSize=50, 
                    (GameObject)objectsParent);

Spawn:

GameObject spawned = TinyPool.Spawn((string)PoolID, 
                                    (Vector3)Position, 
                                    (Quaternion)Rotation, 
                                    (Vector3)Scale);

Destroy:

TinyPool.Destroy((string)PoolID, (GameObject)pooledObject);

Expand:

TinyPool.ExpandPool((string)PoolID, (GameObject)pooledObject);

Result:

Example

Installation

Just add this class to your Unity project.

Considerations

  • You have to call Initialize() just once and before any other TinyPool function.
  • You can create any number of pools at the same time, just be aware of givin them a different PoolID.

Thanks for visiting!

Feel free to use this library whatever you want whenever you want.

You can reach me at twitter @c4m170 for any questions.

About

A small, simple and easy to use pooling system for Unity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages