PoolGen
1.0
|
Handles the pooling of objects. It will apply a PoolUser to each of its pooled objects. More...
Public Member Functions | |
void | ClearAll () |
Destroys all pooled and spawned objects More... | |
void | Despawn (PoolUser user) |
Despawns a PoolUser More... | |
void | Despawn () |
Despawns the oldest spawned object More... | |
void | DespawnAll () |
Despawns all objects More... | |
void | Initialize () |
Sets up the necessary variables and fills the object pool More... | |
GameObject | Instantiate () |
Instantiates an object for usage with the pool with default position and rotation More... | |
GameObject | Instantiate (Vector3 position, Quaternion rotation) |
Instantiates an object for usage with the pool More... | |
PoolUser | Pool () |
Attempts to add an object to the pool then returns it. If the pool is full then it returns null. More... | |
void | PoolCount (int count) |
Attempts to pool a specified amount of objects More... | |
PoolUser | Spawn () |
Attempts to spawn an object from the pool with default position and rotation More... | |
PoolUser | Spawn (Vector3 position, Quaternion rotation) |
Attempts to spawn an object from the pool More... | |
Properties | |
int | CapacityLeft [get] |
How many spawned objects can fit back into the pool More... | |
bool | IsNetworked [get] |
Will the object pool use Unity's networking system. Should be set before the object pool is initialized (or before objects are first pooled). If true, Despawn and Spawn can only be called by the Host (on the Server). More... | |
bool | IsPoolFull [get] |
If true, the TotalCount is equal or greater than the PoolPrefab.PoolSize and it cannot expand More... | |
bool | IsPoolOverflowing [get] |
If true, the TotalCount is greater than the PoolPrefab.PoolSize and it cannot expand More... | |
PoolManager | PoolManagerComponent [get, set] |
The PoolGen.PoolManager that this ObjectPool belongs to More... | |
Stack< PoolUser > | PooledObjects [get, set] |
A stack of pooled objects. Takes advantage of Stack{T} for better memory usage. More... | |
PoolPrefab | PoolPrefab [get] |
PoolGen.PoolPrefab data from the PoolManagerComponent More... | |
int | PrefabID [get] |
ID of the PoolGen.PoolPrefab More... | |
int | PrefabIndex [get, set] |
Index of the PoolGen.PoolPrefab in PoolManagerComponent More... | |
List< PoolUser > | SpawnedObjects [get, set] |
List of spawned PoolUsers More... | |
int | TotalCount [get] |
Total number of pooled and spawned objects More... | |
Handles the pooling of objects. It will apply a PoolUser to each of its pooled objects.
void ClearAll | ( | ) |
Destroys all pooled and spawned objects
void Despawn | ( | ) |
Despawns the oldest spawned object
void DespawnAll | ( | ) |
Despawns all objects
void Initialize | ( | ) |
Sets up the necessary variables and fills the object pool
GameObject Instantiate | ( | ) |
Instantiates an object for usage with the pool with default position and rotation
GameObject Instantiate | ( | Vector3 | position, |
Quaternion | rotation | ||
) |
Instantiates an object for usage with the pool
PoolUser Pool | ( | ) |
Attempts to add an object to the pool then returns it. If the pool is full then it returns null.
void PoolCount | ( | int | count | ) |
Attempts to pool a specified amount of objects
PoolUser Spawn | ( | ) |
Attempts to spawn an object from the pool with default position and rotation
PoolUser Spawn | ( | Vector3 | position, |
Quaternion | rotation | ||
) |
Attempts to spawn an object from the pool
|
get |
How many spawned objects can fit back into the pool
|
get |
Will the object pool use Unity's networking system. Should be set before the object pool is initialized (or before objects are first pooled). If true, Despawn and Spawn can only be called by the Host (on the Server).
|
get |
If true, the TotalCount is equal or greater than the PoolPrefab.PoolSize and it cannot expand
|
get |
If true, the TotalCount is greater than the PoolPrefab.PoolSize and it cannot expand
|
getset |
A stack of pooled objects. Takes advantage of Stack{T} for better memory usage.
|
getset |
The PoolGen.PoolManager that this ObjectPool belongs to
|
get |
PoolGen.PoolPrefab data from the PoolManagerComponent
|
get |
ID of the PoolGen.PoolPrefab
|
getset |
Index of the PoolGen.PoolPrefab in PoolManagerComponent
|
get |
Total number of pooled and spawned objects