Interface IPool
Represents a generic pool interface for managing and reusing GameObjects.
Namespace: GUPS.EasyPooling.Pooling
Assembly: cs.temp.dll.dll
Syntax
public interface IPool
Remarks
The IPool interface defines a contract for managing a pool of GameObjects, allowing for efficient object reuse. It includes methods to spawn and despawn GameObjects, each with various options for customization.
The pool is characterized by its pooling strategy, capacity, and current count of GameObjects in the pool.
Properties
Capacity
Gets the capacity of the pool.
Declaration
int Capacity { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Count
Gets the number of GameObjects in the pool.
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Strategy
Gets the pooling strategy of the pool.
Declaration
EPoolingStrategy Strategy { get; }
Property Value
Type | Description |
---|---|
EPoolingStrategy |
Methods
Despawn(GameObject)
Despawns a poolable GameObject back into the pool.
Declaration
void Despawn(GameObject _PoolAble)
Parameters
Type | Name | Description |
---|---|---|
GameObject | _PoolAble | The poolable GameObject to despawn. |
Despawn(GameObject, IUnDecorator)
Despawns a poolable GameObject back into the pool using a provided un-decorator.
Declaration
void Despawn(GameObject _PoolAble, IUnDecorator _UnDecorator)
Parameters
Type | Name | Description |
---|---|---|
GameObject | _PoolAble | The poolable GameObject to despawn. |
IUnDecorator | _UnDecorator | The un-decorator to apply to the despawned GameObject. |
Spawn()
Spawns a GameObject using the default settings.
Declaration
GameObject Spawn()
Returns
Type | Description |
---|---|
GameObject |
Spawn(IDecorator)
Spawns a GameObject with a provided decorator.
Declaration
GameObject Spawn(IDecorator _Decorator)
Parameters
Type | Name | Description |
---|---|---|
IDecorator | _Decorator | The decorator to apply to the spawned GameObject. |
Returns
Type | Description |
---|---|
GameObject |
Spawn(IDecorator, Vector3, Quaternion)
Spawns a GameObject with a provided decorator at the specified position and rotation.
Declaration
GameObject Spawn(IDecorator _Decorator, Vector3 _Position, Quaternion _Rotation)
Parameters
Type | Name | Description |
---|---|---|
IDecorator | _Decorator | The decorator to apply to the spawned GameObject. |
Vector3 | _Position | The position at which to spawn the GameObject. |
Quaternion | _Rotation | The rotation at which to spawn the GameObject. |
Returns
Type | Description |
---|---|
GameObject |
Spawn(Vector3, Quaternion)
Spawns a GameObject at the specified position and rotation.
Declaration
GameObject Spawn(Vector3 _Position, Quaternion _Rotation)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | _Position | The position at which to spawn the GameObject. |
Quaternion | _Rotation | The rotation at which to spawn the GameObject. |
Returns
Type | Description |
---|---|
GameObject |