Twoorb Plugins  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Twoorb.PrefabSystem.PrefabObjectPool Class Reference

An object pool for prefab instantiation. Used for AssetBundle reference counting More...

Public Member Functions

 PrefabObjectPool (GameObject sourceObject)
 Creates a new prefab object pool. More...
 
void DestroyAllObjects ()
 Destroys all the objects in this pool using GameObject.Destroy() and clear the list. More...
 
GameObject FetchObject (Transform parent=null)
 Gets an object from the pool More...
 
void RecycleObject (GameObject poolObject)
 Recycles an object and returns it to the pool More...
 

Properties

bool HasReferences [get]
 Does this object pool have any references attached to it? More...
 
int NumberOfAliveReferences [get]
 The references to objects fetched from this pool More...
 

Detailed Description

An object pool for prefab instantiation. Used for AssetBundle reference counting

Constructor & Destructor Documentation

Twoorb.PrefabSystem.PrefabObjectPool.PrefabObjectPool ( GameObject  sourceObject)

Creates a new prefab object pool.

Parameters
sourceObjectThe prefab object used to instantiate the objects with.

Member Function Documentation

void Twoorb.PrefabSystem.PrefabObjectPool.DestroyAllObjects ( )

Destroys all the objects in this pool using GameObject.Destroy() and clear the list.

GameObject Twoorb.PrefabSystem.PrefabObjectPool.FetchObject ( Transform  parent = null)

Gets an object from the pool

Parameters
parentOptional parameter to set a parent to the fetched game object
Returns
The gameobject
void Twoorb.PrefabSystem.PrefabObjectPool.RecycleObject ( GameObject  poolObject)

Recycles an object and returns it to the pool

Parameters
poolObjectThe object to recycle

Property Documentation

bool Twoorb.PrefabSystem.PrefabObjectPool.HasReferences
get

Does this object pool have any references attached to it?

int Twoorb.PrefabSystem.PrefabObjectPool.NumberOfAliveReferences
get

The references to objects fetched from this pool


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