My Project
Loading...
Searching...
No Matches
Classes | Public Member Functions | Properties | List of all members
CreativeSpore.PoolExtension.PoolBehaviour Class Reference
Inheritance diagram for CreativeSpore.PoolExtension.PoolBehaviour:

Public Member Functions

void Initialize ()
 
void PreCacheInstances (int count)
 This will destroy all the children gameObjects and instantiate as many prefab instances in the pool as the count value.
 
bool TryAddGameObjectToPool (GameObject obj)
 This method should be called by PoolBehaviourEditor.
 
void RemoveNullGameObjects (bool warningLogEnabled=true)
 If an instance of the pool is destroyed using Object.Destroy, instead of using this.PoolDestroy, the instance will become null. This will force a cleaning of the pool removing all the null instances.
 
GameObject Instantiate (Vector3 position, Quaternion rotation=default(Quaternion), Transform parent=null, bool instantiateInWorldSpace=false)
 Instantiate a gameObject using the pool. The prefab property will be used as template.
 
GameObject Instantiate (Transform parent=null, bool instantiateInWorldSpace=false)
 
Component Instantiate (System.Type componentType, Transform parent=null, bool instantiateInWorldSpace=false)
 
Component Instantiate (System.Type componentType, Vector3 position, Quaternion rotation=default(Quaternion), Transform parent=null, bool instantiateInWorldSpace=false)
 
void Destroy (GameObject obj, float time=0f)
 
bool TryDestroy (GameObject obj, float time=0f)
 
void DestroyAll ()
 Destroy all the active instances of the pool. The instances will be deactivated, not removed from memory.
 

Properties

GameObject Prefab [get, set]
 The prefab used to instantiate gameObjects with this pool.
 
int ActiveCount [get]
 How many instances are active in this pool.
 
int CacheSize [get]
 How many instances are available in the pool to be activated without instantiating a new instance.
 

Member Function Documentation

◆ Instantiate()

GameObject CreativeSpore.PoolExtension.PoolBehaviour.Instantiate ( Vector3  position,
Quaternion  rotation = default(Quaternion),
Transform  parent = null,
bool  instantiateInWorldSpace = false 
)
inline

Instantiate a gameObject using the pool. The prefab property will be used as template.

Parameters
position
rotation
parent
instantiateInWorldSpace
Returns

◆ PreCacheInstances()

void CreativeSpore.PoolExtension.PoolBehaviour.PreCacheInstances ( int  count)
inline

This will destroy all the children gameObjects and instantiate as many prefab instances in the pool as the count value.

Parameters
count

◆ RemoveNullGameObjects()

void CreativeSpore.PoolExtension.PoolBehaviour.RemoveNullGameObjects ( bool  warningLogEnabled = true)
inline

If an instance of the pool is destroyed using Object.Destroy, instead of using this.PoolDestroy, the instance will become null. This will force a cleaning of the pool removing all the null instances.

Parameters
warningLogEnabled

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