PoolGen  1.0
Public Member Functions | Static Public Member Functions | Properties | List of all members
PoolUser Class Reference

An object that is pooled in an ObjectPool More...

Inherits MonoBehaviour.

Public Member Functions

void Despawn ()
 Returns the object to the pool. If InPool is null, this GameObject will be destroyed. More...
 
void SpawnHere (string poolManager)
 Spawns an object from a specified PoolManager at this position More...
 
void SpawnHere (string poolManager, Vector3 position)
 Spawns an object from a specified PoolManager at a specified position More...
 
void SpawnHere (string poolManager, Vector3 position, Quaternion rotation)
 Spawns an object from a specified PoolManager at a specified position and rotation More...
 
void StartTimedDespawn (float time)
 Starts a timer to despawn this GameObject More...
 
void StopTimedDespawn ()
 Stops the self destruction (despawnation?) timer More...
 

Static Public Member Functions

static PoolUser BecomeUser (GameObject gameObject, PoolManager pool, int prefabIndex)
 Adds the PoolUser component to specified GameObject with the necessary pool info More...
 

Properties

PoolPrefab Prefab [get]
 The PoolPrefab that this object is related to More...
 
int PrefabIndex [get, set]
 Index of the PoolPrefab More...
 
PoolManager InPool [get, set]
 The user belongs to this PoolManager for the PoolManager More...
 
UnityEvent OnDespawn [get, set]
 An object from the pool has despawned More...
 
UnityEvent OnPool [get, set]
 An object from the pool has been pooled More...
 
UnityEvent OnSpawn [get, set]
 An object from the pool has spawned More...
 

Detailed Description

An object that is pooled in an ObjectPool

Member Function Documentation

static PoolUser BecomeUser ( GameObject  gameObject,
PoolManager  pool,
int  prefabIndex 
)
static

Adds the PoolUser component to specified GameObject with the necessary pool info

void Despawn ( )

Returns the object to the pool. If InPool is null, this GameObject will be destroyed.

void SpawnHere ( string  poolManager)

Spawns an object from a specified PoolManager at this position

void SpawnHere ( string  poolManager,
Vector3  position 
)

Spawns an object from a specified PoolManager at a specified position

void SpawnHere ( string  poolManager,
Vector3  position,
Quaternion  rotation 
)

Spawns an object from a specified PoolManager at a specified position and rotation

void StartTimedDespawn ( float  time)

Starts a timer to despawn this GameObject

void StopTimedDespawn ( )

Stops the self destruction (despawnation?) timer

Property Documentation

PoolManager InPool
getset

The user belongs to this PoolManager for the PoolManager

UnityEvent OnDespawn
getset

An object from the pool has despawned

UnityEvent OnPool
getset

An object from the pool has been pooled

UnityEvent OnSpawn
getset

An object from the pool has spawned

PoolPrefab Prefab
get

The PoolPrefab that this object is related to

int PrefabIndex
getset

Index of the PoolPrefab