-
Notifications
You must be signed in to change notification settings - Fork 0
Pooling
Andrés Eduardo Maldonado edited this page Jul 26, 2019
·
6 revisions
Public static class.
This is the entry point to the system. Use this to spawn GameObjects that will be used frequently.
Use Pooling.GetFromPool(GameObject, Vector3, Quaternion)
instead of Instantiate().
Use Pooling.SendToPool(GameObject)
instead of Destroy().
Returns | Name | Description |
---|---|---|
GameObject[] | Preload | Spawns the prefabs then deactivates them ready to be used. This will call Awake but not IPoolable.OnPoolSpawn nor IPoolable.OnPoolUnSpawn. |
GameObject | GetFromPool | (2 Overloads) Gets one inactive object from a pool then activates it. If the object doesn't exist, a new pool will be created. This will call IPoolable.OnPoolSpawn. |
void | SendToPool | Collects the object to its pool then deactivates it, ready for next use. If it doesn't have a pool, it will be destroyed. This will call IPoolable.OnPoolUnSpawn. |
See Pooling.Category
Additionally you can configure the log messages to show:
// :: Console Log Settings
public static readonly bool LOG_MESSAGE = true;
public static readonly bool LOG_WARNINGS = true;
public static readonly bool LOG_ERRORS = true;