Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 1.44 KB

README.md

File metadata and controls

77 lines (56 loc) · 1.44 KB

Made With Unity License Last Commit Repo Size Last Release

What

  • Object-Pooling for game unity is very easy to use

How To Install

Add the line below to Packages/manifest.json

for version 1.0.1

"com.wolf-org.object-pooling":"https://github.com/unity-package/object-pooling-unity.git#1.0.1",

Use

  • Init Pool
    Pool.InitPool();
  • Spawn/DeSpawn Object
    public GameObject prefab;

    private GameObject ins;

    void SpawnIns()
    {
        ins = Pool.Spawn(prefab);
    }

    void DeSpawnIns()
    {
        Pool.DeSpawn(ins);
    }

Or

    public GameObject prefab;

    private GameObject ins;

    void SpawnIns()
    {
        ins = prefab.Spawn();
    }

    void DeSpawnIns()
    {
        ins.DeSpawn();
    }