Pool Boss
V 1.2.1
The ultimate pooling solution!
|
This class is used to spawn and despawn things using pooling (avoids Instantiate and Destroy calls). More...
Static Public Member Functions | |
static void | Initialize () |
Called automatically by default. If you uncheck "Create Items On Start", 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 | DespawnAllPrefabs () |
This method will despawn all spawned instances of prefabs. More... | |
static void | DespawnAllPrefabsInCategory (string category) |
This method will Despawn all spawned instances of all prefabs in a single category. 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 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... | |
static bool | IsReady [get] |
This property is set to true when all pool items are ready to spawn. More... | |
This class is used to spawn and despawn things using pooling (avoids Instantiate and Destroy calls).
|
static |
Call this method to find out if all are despawned
transPrefab | The transform of the prefab you are asking about. |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.AllOfPrefabAreDespawned().
|
static |
This method returns a list of active items in a category.
category | Category name |
|
static |
This method returns the number of items in a category that are currently despawned.
category | Category name |
|
static |
return a list of all available despawned clones in a category
category | Category name |
|
static |
This method returns the number of items in a category that are currently spawned.
category | Category name |
|
static |
This method allows you to add a new Pool Item at runtime.
itemTrans | The Transform of the item. |
preloadInstances | The number of instances to preload. |
canInstantiateMore | Can instantiate more or not |
hardLimit | Item Hard Limit |
logMsgs | Log messages during spawn and despawn. |
catName | Category name |
prefabSource | Prefab source |
isTemporary | Do not pass this, used by PoolMiniBoss |
itemCreatedCallback | Do not pass this, used by PoolMiniBoss |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.CreateNewPoolItem().
|
static |
Call this method to despawn a prefab using Pool Boss. All the Spawners and Killable use this method.
transToDespawn | Transform to despawn |
keepParent | Specify true if you want the Game Object to stay where it is in the Hierarch (necessary for UI and come other components) |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.Despawn().
|
static |
This method will despawn all spawned instances of the prefab you pass in.
transToDespawn | Transform component of a prefab |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.DespawnAllOfPrefab(), and DarkTonic.PoolBoss.PoolMiniBoss.RemoveItems().
|
static |
This method will despawn all spawned instances of prefabs.
|
static |
This method will Despawn all spawned instances of all prefabs in a single category.
category | Category name to affect |
|
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 |
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.
categoryName | Category to destroy items of. |
|
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.
transDeadItem | Trans dead item |
prefabSource | Pass in "Addressable" if you are destroying an Addressable |
Referenced by DarkTonic.PoolBoss.PoolMiniBoss.RemoveItems().
|
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.
trans | The Transform of the game object |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.GetPrefabName().
|
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.
go | The Game Object of the game object |
|
static |
This will return the name of the game object's prefab without "(Clone X)" in the name.
prefabName | The name of the game object |
|
static |
Called automatically by default. If you uncheck "Create Items On Start", you will need to call this after your client has joined the room so they have Pool Boss.
|
static |
Returns whether a specified Game Object is spawned. If not, the it's available to spawn.
go | The game object in question |
|
static |
Call this get the next available item to spawn for a pool item.
trans | Transform you want to get the next item to spawn for. |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.NextPoolItemToSpawn().
|
static |
Call this get the next available item to spawn for a pool item.
itemName | Name of item you want to get the next item to spawn for. |
|
static |
Call this method get info on a Pool Boss item (number of spawned and despawned copies, allow instantiate more, log etc).
poolItemName | The name of the prefab you're asking about. |
|
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
transPrefab | The transform component of the prefab you want the despawned count of. |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.PrefabDespawnedCount().
|
static |
Call this method determine if the item (Transform) you pass in is set up in Pool Boss.
trans | Transform you want to know is in the Pool or not. |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.PrefabIsInPool().
|
static |
Call this method determine if the item name you pass in is set up in Pool Boss.
transName | Item name you want to know is in the Pool or not. |
|
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
transPrefab | The transform component of the prefab you want the spawned count of. |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.PrefabSpawnedCount().
|
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.
poolable |
|
static |
Call this method to spawn a prefab using Pool Boss. All the Spawners and Killable use this method.
transToSpawn | Transform to spawn |
position | The position to spawn it at |
rotation | The rotation to use |
parentTransform | The parent Transform to use |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.Spawn().
|
static |
Call this method to spawn a prefab using Pool Boss. All the Spawners and Killable use this method.
itemName | Name of the transform to spawn |
position | The position to spawn it at |
rotation | The rotation to use |
parentTransform | The parent Transform to use |
|
static |
Call this method to spawn a prefab using Pool Boss, which will be a child of the Pool Boss prefab.
itemName | Name of Transform to spawn |
position | The position to spawn it at |
rotation | The rotation to use |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.SpawnInPool().
|
static |
Call this method to spawn a prefab using Pool Boss, which will be a child of the Pool Boss prefab.
transToSpawn | Transform to spawn |
position | The position to spawn it at |
rotation | The rotation to use |
|
static |
Call this method to spawn a prefab using Pool Boss, which will be spawned with no parent Transform (outside the pool)
itemName | Name of Transform to spawn |
position | The position to spawn it at |
rotation | The rotation to use |
Referenced by DarkTonic.PoolBoss.PoolBossExtensions.SpawnOutsidePool().
|
static |
Call this method to spawn a prefab using Pool Boss, which will be spawned with no parent Transform (outside the pool)
transToSpawn | Transform to spawn |
position | The position to spawn it at |
rotation | The rotation to use |
|
static |
This is called by PoolableInfo components that get spawned, so we know to remove them from the in scene objects list.
poolable |
|
staticget |
This property is set to true when all pool items are ready to spawn.
|
staticget |
This property will tell you how many different items are set up in Pool Boss.