PoolManager

  • defaultSize: Size of Default Pool Collections

  • largePoolSize: Size of Large Pool Collections

  • defaultReturnTime: Default Time to return Objets to their Pool Collection

  • damagePopUpsReturnTime: Time to return pop ups to their Pool Collection.

  • Instance: Pool Manager Singleton.

RegisterPool(GameObject prefab, int size)

Registers a new pool given a prefab and the size of the collection.

  • prefab: Prefab reference to register the collection

  • size: Size of the collection = Initial instances to spawn.

GetFromPool(GameObject prefab, Vector3 position, Quaternion rotation)

Gets a gameobject from its collection at a given position and rotation. Stablishes default return times.

GetFromPool(GameObject prefab, Vector3 position, Quaternion rotation, float returnToPool)

Gets a gameobject from its collection at a given position and rotation. Stablishes default return times.

Allows to pass custom return times.

ReturnToPool(GameObject obj, GameObject prefab)

Immediately returns a gameobject (obj) into its corresponding collection ( references by prefab )

RemovePool(GameObject prefab)

Completely destroy a Pool Collection and all its instances.

Last updated