Tanks Multiplayer  1.4
Public Member Functions | Public Attributes | List of all members
Pool

Child class interacting and managed by the PoolManager. Handles all internal spawning/despawning of active/inactive instances. More...

Inheritance diagram for Pool:

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...
 

Detailed Description

Child class interacting and managed by the PoolManager. Handles all internal spawning/despawning of active/inactive instances.

Member Function Documentation

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.

Member Data Documentation

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.


The documentation for this class was generated from the following file: