ScriptableGameObjectPool Class
Definition
Section titled “Definition”A UnityEngine.ScriptableObject that holds a pool of UnityEngine.GameObject.
[CreateAssetMenu(fileName = "New Game Object Pool", menuName = "Hertzole/Scriptable Values/Pools/Game Object Pool", order = -850)]public class ScriptableGameObjectPool : ScriptablePool<GameObject>, INotifyPropertyChanging, INotifyPropertyChanged, IStackTraceProvider, IPoolCallbacks<GameObject>Inheritance object → UnityEngine.Object → UnityEngine.ScriptableObject → RuntimeScriptableObject → ScriptablePool → ScriptablePool<GameObject>
Implements INotifyPropertyChanging, INotifyPropertyChanged, IStackTraceProvider, IPoolCallbacks<GameObject>
Properties
Section titled “Properties”Prefab
Section titled “Prefab”public GameObject Prefab { get; set; }Methods
Section titled “Methods”CreateObject()
Section titled “CreateObject()”Called when a new object needs to be created.
protected override GameObject CreateObject()Returns
Section titled “Returns”UnityEngine.GameObject
DestroyObject(GameObject)
Section titled “DestroyObject(GameObject)”Called when an object needs to be destroyed.
protected override void DestroyObject(GameObject item)Parameters
Section titled “Parameters”item UnityEngine.GameObject
The object to be destroyed.
OnGet(GameObject)
Section titled “OnGet(GameObject)”Called when an object is retrieved from the pool.
protected override void OnGet(GameObject item)Parameters
Section titled “Parameters”item UnityEngine.GameObject
The object that was retrieved from the pool.
OnReturn(GameObject)
Section titled “OnReturn(GameObject)”Called when an object is returned to the pool.
protected override void OnReturn(GameObject item)Parameters
Section titled “Parameters”item UnityEngine.GameObject
The object that was returned to the pool.