Interface IPoolAble
Represents an interface for poolable objects, providing methods to manage object lifecycle events within and outside of a pool.
Namespace: GUPS.EasyPooling.Pooling
Assembly: cs.temp.dll.dll
Syntax
public interface IPoolAble
Remarks
The IPoolAble interface defines a contract for objects that can be used for pooling. It includes properties to identify the owning pool and the current pooled state, along with methods to handle key lifecycle events.
Implementations of this interface are expected to handle events such as creation, spawning, despawning, and destruction, allowing for efficient management of object reuse within a pool.
Properties
IsPooled
Indicating whether this poolable object is inactive in its pool.
Declaration
bool IsPooled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Owner
The pool this poolable object belongs to.
Declaration
IPool Owner { get; set; }
Property Value
Type | Description |
---|---|
IPool |
Methods
OnCreate()
Called when the poolable object is newly created by the pool and not received from any already pooled object.
Declaration
void OnCreate()
OnDespawn()
Called when the poolable object is despawned and returned to the pool.
Declaration
void OnDespawn()
OnDestroy()
Called when the poolable object is destroyed and will not return to the pool.
Declaration
void OnDestroy()
OnSpawn()
Called when the poolable object is spawned from the pool or after OnCreate().
Declaration
void OnSpawn()