Tanks Multiplayer
1.4
|
Child class interacting and managed by the PoolManager. Handles all internal spawning/despawning of active/inactive instances. More...
Public Member Functions | |
void | Awake () |
Initialization called by PoolManager on runtime created pools. More... | |
void | PreLoad () |
Loads specified amount of objects before playtime. More... | |
GameObject | Spawn (Vector3 position, Quaternion rotation) |
Activates (or instantiates) a new instance for this pool. More... | |
void | Despawn (GameObject instance) |
Deactivates an instance of this pool for later use. More... | |
void | Despawn (GameObject instance, float time) |
Timed deactivation of an instance of this pool for later use. More... | |
void | DestroyUnused (bool limitToPreLoad) |
Destroys all inactive instances of this pool (garbage collector heavy). The parameter determines if only instances above the preLoad value should be destroyed. More... | |
void | DestroyCount (int count) |
Destroys a specific amount of inactive instances (garbage collector heavy). More... | |
Public Attributes | |
GameObject | prefab |
Prefab to instantiate for pooling. More... | |
int | preLoad = 0 |
Amount of instances to create at game start. More... | |
bool | limit = false |
Whether the creation of new instances should be limited at runtime. More... | |
int | maxCount |
Maximum amount of instances created, if limit is enabled. More... | |
List< GameObject > | active = new List<GameObject>() |
List of active prefab instances for this pool. More... | |
List< GameObject > | inactive = new List<GameObject>() |
List of inactive prefab instances for this pool. More... | |
Child class interacting and managed by the PoolManager. Handles all internal spawning/despawning of active/inactive instances.
void Awake | ( | ) |
Initialization called by PoolManager on runtime created pools.
void Despawn | ( | GameObject | instance | ) |
Deactivates an instance of this pool for later use.
void Despawn | ( | GameObject | instance, |
float | time | ||
) |
Timed deactivation of an instance of this pool for later use.
void DestroyCount | ( | int | count | ) |
Destroys a specific amount of inactive instances (garbage collector heavy).
void DestroyUnused | ( | bool | limitToPreLoad | ) |
Destroys all inactive instances of this pool (garbage collector heavy). The parameter determines if only instances above the preLoad value should be destroyed.
void PreLoad | ( | ) |
Loads specified amount of objects before playtime.
GameObject Spawn | ( | Vector3 | position, |
Quaternion | rotation | ||
) |
Activates (or instantiates) a new instance for this pool.
List<GameObject> active = new List<GameObject>() |
List of active prefab instances for this pool.
List<GameObject> inactive = new List<GameObject>() |
List of inactive prefab instances for this pool.
bool limit = false |
Whether the creation of new instances should be limited at runtime.
int maxCount |
Maximum amount of instances created, if limit is enabled.
GameObject prefab |
Prefab to instantiate for pooling.
int preLoad = 0 |
Amount of instances to create at game start.