Core GameKit  3.2.9.0
The ultimate pooling / combat / spawning / variable plugin!
DarkTonic.CoreGameKit.PoolBoss Class Reference

This class is used to spawn and despawn things using pooling (avoids Instantiate and Destroy calls). More...

Inheritance diagram for DarkTonic.CoreGameKit.PoolBoss:

Static Public Member Functions

static void Initialize ()
 Called automatically when not using Multiplayer / Photon. If you are using Multiplayer / Photon, you will need to call this after your client has joined the room so they have Pool Boss. More...
 
static void RegisterPotentialInScenePoolable (PoolableInfo poolable)
 This is called by PoolableInfo components on objects that begin in the Scene, so Pool Boss will know about them and put them in the "Spawned" list. More...
 
static void UnregisterNonStartInScenePoolable (PoolableInfo poolable)
 This is called by PoolableInfo components that get spawned, so we know to remove them from the in scene objects list. More...
 
static void DestroyAllItemsAndReleaseMemory ()
 Call this method before changing to a Scene where Pool Boss would be automatically destroyed if you need to reclaim the memory from Addressables. More...
 
static void CreateNewPoolItem (Transform itemTrans, int preloadInstances, bool canInstantiateMore, int hardLimit, bool logMsgs, string catName, PrefabSource prefabSource, bool isTemporary=false, Action itemCreatedCallback=null)
 This method allows you to add a new Pool Item at runtime. More...
 
static Transform SpawnOutsidePool (string itemName, Vector3 position, Quaternion rotation)
 Call this method to spawn a prefab using Pool Boss, which will be spawned with no parent Transform (outside the pool) More...
 
static Transform SpawnOutsidePool (Transform transToSpawn, Vector3 position, Quaternion rotation)
 Call this method to spawn a prefab using Pool Boss, which will be spawned with no parent Transform (outside the pool) More...
 
static Transform SpawnInPool (string itemName, Vector3 position, Quaternion rotation)
 Call this method to spawn a prefab using Pool Boss, which will be a child of the Pool Boss prefab. More...
 
static Transform SpawnInPool (Transform transToSpawn, Vector3 position, Quaternion rotation)
 Call this method to spawn a prefab using Pool Boss, which will be a child of the Pool Boss prefab. More...
 
static Transform Spawn (Transform transToSpawn, Vector3 position, Quaternion rotation, Transform parentTransform)
 Call this method to spawn a prefab using Pool Boss. All the Spawners and Killable use this method. More...
 
static Transform Spawn (string itemName, Vector3 position, Quaternion rotation, Transform parentTransform)
 Call this method to spawn a prefab using Pool Boss. All the Spawners and Killable use this method. More...
 
static int CategoryItemsDespawned (string category)
 This method returns the number of items in a category that are currently despawned. More...
 
static List< Transform > CategoryItemsDespawnedList (string category)
 return a list of all available despawned clones in a category More...
 
static List< Transform > CategoryActiveItems (string category)
 This method returns a list of active items in a category. More...
 
static int CategoryItemsSpawned (string category)
 This method returns the number of items in a category that are currently spawned. More...
 
static bool Despawn (Transform transToDespawn, bool keepParent=false)
 Call this method to despawn a prefab using Pool Boss. All the Spawners and Killable use this method. More...
 
static void DamageAllPrefabs (int damagePoints)
 This method will damage all spawned instances of prefabs. More...
 
static void DespawnAllPrefabs ()
 This method will despawn all spawned instances of prefabs. More...
 
static void KillAllPrefabs ()
 This method will "Kill" all spawned instances of all prefab. More...
 
static void DespawnAllPrefabsInCategory (string category)
 This method will Despawn all spawned instances of all prefabs in a single category. More...
 
static void DamageAllPrefabsInCategory (string category, int damagePoints)
 This method will damage all spawned instances of all prefabs in a single category. More...
 
static void KillAllPrefabsInCategory (string category)
 This method will "Kill" all spawned instances of all prefabs in a single category. More...
 
static void DamageAllOfPrefab (Transform transToDespawn, int damagePoints)
 This method will damage all spawned instances of the prefab you pass in. More...
 
static void DespawnAllOfPrefab (Transform transToDespawn)
 This method will despawn all spawned instances of the prefab you pass in. More...
 
static void DestroyPoolItem (Transform transDeadItem, PrefabSource prefabSource)
 Destroys the pool item, and all prefabs from it that are already spawned. You should never call this except maybe during a new Scene load when you no longer need an item. More...
 
static void DestroyCategoryPoolItems (string categoryName)
 Destroys all pool items in the category specified, and all prefabs from it that are already spawned. You should never call this except maybe during a new Scene load when you no longer need all items in a category. More...
 
static void KillAllOfPrefab (Transform transToKill)
 This method will "Kill" all spawned instances of the prefab you pass in. More...
 
static Transform NextPoolItemToSpawn (Transform trans)
 Call this get the next available item to spawn for a pool item. More...
 
static Transform NextPoolItemToSpawn (string itemName)
 Call this get the next available item to spawn for a pool item. More...
 
static PoolItemInstanceList PoolItemInfoByName (string poolItemName)
 Call this method get info on a Pool Boss item (number of spawned and despawned copies, allow instantiate more, log etc). More...
 
static bool PrefabIsInPool (Transform trans)
 Call this method determine if the item (Transform) you pass in is set up in Pool Boss. More...
 
static bool PrefabIsInPool (string transName)
 Call this method determine if the item name you pass in is set up in Pool Boss. More...
 
static int PrefabDespawnedCount (Transform transPrefab)
 This will tell you how many available clones of a prefab are despawned and ready to spawn. A value of -1 indicates an error More...
 
static int PrefabSpawnedCount (Transform transPrefab)
 This will tell you how many clones of a prefab are already spawned out of Pool Boss. A value of -1 indicates an error More...
 
static bool AllOfPrefabAreDespawned (Transform transPrefab)
 Call this method to find out if all are despawned More...
 
static string GetPrefabName (Transform trans)
 This will return the name of the game object's prefab without "(Clone X)" in the name. It is used internally by PoolBoss for a lot of things. More...
 
static string GetPrefabName (GameObject go)
 This will return the name of the game object's prefab without "(Clone X)" in the name. It is used internally by PoolBoss for a lot of things. More...
 
static string GetPrefabShortName (string prefabName)
 This will return the name of the game object's prefab without "(Clone X)" in the name. More...
 
static bool IsSpawned (GameObject go)
 Returns whether a specified Game Object is spawned. If not, the it's available to spawn. More...
 

Properties

static int PrefabCount [get]
 This property will tell you how many different items are set up in Pool Boss. More...
 

Detailed Description

This class is used to spawn and despawn things using pooling (avoids Instantiate and Destroy calls).

Member Function Documentation

static bool DarkTonic.CoreGameKit.PoolBoss.AllOfPrefabAreDespawned ( Transform  transPrefab)
static

Call this method to find out if all are despawned

Parameters
transPrefabThe transform of the prefab you are asking about.
Returns
Boolean value.
static List<Transform> DarkTonic.CoreGameKit.PoolBoss.CategoryActiveItems ( string  category)
static

This method returns a list of active items in a category.

Returns
The active items.
Parameters
categoryCategory name
static int DarkTonic.CoreGameKit.PoolBoss.CategoryItemsDespawned ( string  category)
static

This method returns the number of items in a category that are currently despawned.

Parameters
categoryCategory name
Returns
integer
static List<Transform> DarkTonic.CoreGameKit.PoolBoss.CategoryItemsDespawnedList ( string  category)
static

return a list of all available despawned clones in a category

Parameters
categoryCategory name
Returns
static int DarkTonic.CoreGameKit.PoolBoss.CategoryItemsSpawned ( string  category)
static

This method returns the number of items in a category that are currently spawned.

Parameters
categoryCategory name
Returns
integer
static void DarkTonic.CoreGameKit.PoolBoss.CreateNewPoolItem ( Transform  itemTrans,
int  preloadInstances,
bool  canInstantiateMore,
int  hardLimit,
bool  logMsgs,
string  catName,
PrefabSource  prefabSource,
bool  isTemporary = false,
Action  itemCreatedCallback = null 
)
static

This method allows you to add a new Pool Item at runtime.

Parameters
itemTransThe Transform of the item.
preloadInstancesThe number of instances to preload.
canInstantiateMoreCan instantiate more or not
hardLimitItem Hard Limit
logMsgsLog messages during spawn and despawn.
catNameCategory name
prefabSourcePrefab source
prefabAddressablePrefab Addressable, if Addressable feature enabled
isTemporaryDo not pass this, used by PoolMiniBoss
itemCreatedCallbackDo not pass this, used by PoolMiniBoss
static void DarkTonic.CoreGameKit.PoolBoss.DamageAllOfPrefab ( Transform  transToDespawn,
int  damagePoints 
)
static

This method will damage all spawned instances of the prefab you pass in.

Parameters
transToDespawnTransform component of a prefab
damagePointsHow many points of damage to deal to each
static void DarkTonic.CoreGameKit.PoolBoss.DamageAllPrefabs ( int  damagePoints)
static

This method will damage all spawned instances of prefabs.

Parameters
damagePointsHow many points of damage to deal to each
static void DarkTonic.CoreGameKit.PoolBoss.DamageAllPrefabsInCategory ( string  category,
int  damagePoints 
)
static

This method will damage all spawned instances of all prefabs in a single category.

Parameters
categoryCategory name to affect
damagePointsHow many points of damage to deal to each
static bool DarkTonic.CoreGameKit.PoolBoss.Despawn ( Transform  transToDespawn,
bool  keepParent = false 
)
static

Call this method to despawn a prefab using Pool Boss. All the Spawners and Killable use this method.

Parameters
transToDespawnTransform to despawn
keepParentSpecify true if you want the Game Object to stay where it is in the Hierarch (necessary for UI and come other components)
Returns
true if despawned
static void DarkTonic.CoreGameKit.PoolBoss.DespawnAllOfPrefab ( Transform  transToDespawn)
static

This method will despawn all spawned instances of the prefab you pass in.

Parameters
transToDespawnTransform component of a prefab
static void DarkTonic.CoreGameKit.PoolBoss.DespawnAllPrefabs ( )
static

This method will despawn all spawned instances of prefabs.

static void DarkTonic.CoreGameKit.PoolBoss.DespawnAllPrefabsInCategory ( string  category)
static

This method will Despawn all spawned instances of all prefabs in a single category.

Parameters
categoryCategory name to affect
static void DarkTonic.CoreGameKit.PoolBoss.DestroyAllItemsAndReleaseMemory ( )
static

Call this method before changing to a Scene where Pool Boss would be automatically destroyed if you need to reclaim the memory from Addressables.

static void DarkTonic.CoreGameKit.PoolBoss.DestroyCategoryPoolItems ( string  categoryName)
static

Destroys all pool items in the category specified, and all prefabs from it that are already spawned. You should never call this except maybe during a new Scene load when you no longer need all items in a category.

Parameters
categoryNameCategory to destroy items of.
static void DarkTonic.CoreGameKit.PoolBoss.DestroyPoolItem ( Transform  transDeadItem,
PrefabSource  prefabSource 
)
static

Destroys the pool item, and all prefabs from it that are already spawned. You should never call this except maybe during a new Scene load when you no longer need an item.

Parameters
transDeadItemTrans dead item
prefabSourcePass in "Addressable" if you are destroying an Addressable
addressablePass in the the AssetReference of the Pool Item you are destroying if it is Addressable
static string DarkTonic.CoreGameKit.PoolBoss.GetPrefabName ( Transform  trans)
static

This will return the name of the game object's prefab without "(Clone X)" in the name. It is used internally by PoolBoss for a lot of things.

Parameters
transThe Transform of the game object
Returns
string
static string DarkTonic.CoreGameKit.PoolBoss.GetPrefabName ( GameObject  go)
static

This will return the name of the game object's prefab without "(Clone X)" in the name. It is used internally by PoolBoss for a lot of things.

Parameters
goThe Game Object of the game object
Returns
string
static string DarkTonic.CoreGameKit.PoolBoss.GetPrefabShortName ( string  prefabName)
static

This will return the name of the game object's prefab without "(Clone X)" in the name.

Parameters
prefabNameThe name of the game object
Returns
string
static void DarkTonic.CoreGameKit.PoolBoss.Initialize ( )
static

Called automatically when not using Multiplayer / Photon. If you are using Multiplayer / Photon, you will need to call this after your client has joined the room so they have Pool Boss.

static bool DarkTonic.CoreGameKit.PoolBoss.IsSpawned ( GameObject  go)
static

Returns whether a specified Game Object is spawned. If not, the it's available to spawn.

Parameters
goThe game object in question
Returns
bool
static void DarkTonic.CoreGameKit.PoolBoss.KillAllOfPrefab ( Transform  transToKill)
static

This method will "Kill" all spawned instances of the prefab you pass in.

Parameters
transToKillTransform component of a prefab
static void DarkTonic.CoreGameKit.PoolBoss.KillAllPrefabs ( )
static

This method will "Kill" all spawned instances of all prefab.

static void DarkTonic.CoreGameKit.PoolBoss.KillAllPrefabsInCategory ( string  category)
static

This method will "Kill" all spawned instances of all prefabs in a single category.

Parameters
categoryCategory name to affect
static Transform DarkTonic.CoreGameKit.PoolBoss.NextPoolItemToSpawn ( Transform  trans)
static

Call this get the next available item to spawn for a pool item.

Parameters
transTransform you want to get the next item to spawn for.
Returns
Transform
static Transform DarkTonic.CoreGameKit.PoolBoss.NextPoolItemToSpawn ( string  itemName)
static

Call this get the next available item to spawn for a pool item.

Parameters
itemNameName of item you want to get the next item to spawn for.
Returns
Transform
static PoolItemInstanceList DarkTonic.CoreGameKit.PoolBoss.PoolItemInfoByName ( string  poolItemName)
static

Call this method get info on a Pool Boss item (number of spawned and despawned copies, allow instantiate more, log etc).

Parameters
poolItemNameThe name of the prefab you're asking about.
Returns
The list of pool items.
static int DarkTonic.CoreGameKit.PoolBoss.PrefabDespawnedCount ( Transform  transPrefab)
static

This will tell you how many available clones of a prefab are despawned and ready to spawn. A value of -1 indicates an error

Parameters
transPrefabThe transform component of the prefab you want the despawned count of.
Returns
Integer value.
static bool DarkTonic.CoreGameKit.PoolBoss.PrefabIsInPool ( Transform  trans)
static

Call this method determine if the item (Transform) you pass in is set up in Pool Boss.

Parameters
transTransform you want to know is in the Pool or not.
Returns
Boolean value.
static bool DarkTonic.CoreGameKit.PoolBoss.PrefabIsInPool ( string  transName)
static

Call this method determine if the item name you pass in is set up in Pool Boss.

Parameters
transNameItem name you want to know is in the Pool or not.
Returns
Boolean value.
static int DarkTonic.CoreGameKit.PoolBoss.PrefabSpawnedCount ( Transform  transPrefab)
static

This will tell you how many clones of a prefab are already spawned out of Pool Boss. A value of -1 indicates an error

Parameters
transPrefabThe transform component of the prefab you want the spawned count of.
Returns
Integer value.
static void DarkTonic.CoreGameKit.PoolBoss.RegisterPotentialInScenePoolable ( PoolableInfo  poolable)
static

This is called by PoolableInfo components on objects that begin in the Scene, so Pool Boss will know about them and put them in the "Spawned" list.

Parameters
poolable
static Transform DarkTonic.CoreGameKit.PoolBoss.Spawn ( Transform  transToSpawn,
Vector3  position,
Quaternion  rotation,
Transform  parentTransform 
)
static

Call this method to spawn a prefab using Pool Boss. All the Spawners and Killable use this method.

Parameters
transToSpawnTransform to spawn
positionThe position to spawn it at
rotationThe rotation to use
parentTransformThe parent Transform to use
Returns
The Transform of the spawned object. It can be null if spawning failed from limits you have set.
static Transform DarkTonic.CoreGameKit.PoolBoss.Spawn ( string  itemName,
Vector3  position,
Quaternion  rotation,
Transform  parentTransform 
)
static

Call this method to spawn a prefab using Pool Boss. All the Spawners and Killable use this method.

Parameters
itemNameName of the transform to spawn
positionThe position to spawn it at
rotationThe rotation to use
parentTransformThe parent Transform to use
Returns
The Transform of the spawned object. It can be null if spawning failed from limits you have set.
static Transform DarkTonic.CoreGameKit.PoolBoss.SpawnInPool ( string  itemName,
Vector3  position,
Quaternion  rotation 
)
static

Call this method to spawn a prefab using Pool Boss, which will be a child of the Pool Boss prefab.

Parameters
itemNameName of Transform to spawn
positionThe position to spawn it at
rotationThe rotation to use
Returns
The Transform of the spawned object. It can be null if spawning failed from limits you have set.
static Transform DarkTonic.CoreGameKit.PoolBoss.SpawnInPool ( Transform  transToSpawn,
Vector3  position,
Quaternion  rotation 
)
static

Call this method to spawn a prefab using Pool Boss, which will be a child of the Pool Boss prefab.

Parameters
transToSpawnTransform to spawn
positionThe position to spawn it at
rotationThe rotation to use
Returns
The Transform of the spawned object. It can be null if spawning failed from limits you have set.
static Transform DarkTonic.CoreGameKit.PoolBoss.SpawnOutsidePool ( string  itemName,
Vector3  position,
Quaternion  rotation 
)
static

Call this method to spawn a prefab using Pool Boss, which will be spawned with no parent Transform (outside the pool)

Parameters
itemNameName of Transform to spawn
positionThe position to spawn it at
rotationThe rotation to use
Returns
The Transform of the spawned object. It can be null if spawning failed from limits you have set.
static Transform DarkTonic.CoreGameKit.PoolBoss.SpawnOutsidePool ( Transform  transToSpawn,
Vector3  position,
Quaternion  rotation 
)
static

Call this method to spawn a prefab using Pool Boss, which will be spawned with no parent Transform (outside the pool)

Parameters
transToSpawnTransform to spawn
positionThe position to spawn it at
rotationThe rotation to use
Returns
The Transform of the spawned object. It can be null if spawning failed from limits you have set.
static void DarkTonic.CoreGameKit.PoolBoss.UnregisterNonStartInScenePoolable ( PoolableInfo  poolable)
static

This is called by PoolableInfo components that get spawned, so we know to remove them from the in scene objects list.

Parameters
poolable

Property Documentation

int DarkTonic.CoreGameKit.PoolBoss.PrefabCount
staticget

This property will tell you how many different items are set up in Pool Boss.


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