I want to use Pool Boss programatically since I instantiate a lot of stuff in runtime depending on the stage and level of the game. I've seen that I can call PoolBoss.CreateNewPoolItem to create a new pool and give it a name ID. However I would like to know what function I can use to retrieve (or spawn, aka enable an item) the next available (disabled) item in the pool of a specific name previously defined. So far I've seen I can spawn an item using either the transform of the prefab that was used to create the pool or the name of the instance, but I would like to simple access a pool and get any available item.
Many thanks for your reply, I think I phrased wrong my question. In the points you mention, I can access the instanced either using the name of the instance or the transform of the original prefab. So this is great so far.
However the question is how I access items in categories. For example I want to create a category to store a type of enemies (i.e warriors) and another category to store a different type of enemies (i.e. archers), so I use the following code: PoolBoss.CreateNewPoolItem(warrior_prefab, 10, false, 50, false, "Enemies_Warriors"); PoolBoss.CreateNewPoolItem(archer_prefab, 10, false, 50, false, "Enemies_Archers");
Then I would like to do something like: var nextItem = PoolBoss.NextPoolItemToSpawn("Enemies_Warriors");
As far as I understood the 'categories' are mean to be used to structure instances, but maybe I misunderstood this concept and categories are only for debug purposes through the inspector? (since I cannot find any function that accepts them as argument other than the CreateNewPoolItem.
I see, many thanks for clarifying. I've managed to integrate it in the project by referencing prefabs, should be ok for now I've already upgraded to the game kit, just I wanted to implement the pooling system first, but the spawning features look very interesting as well, I´ll be looking into those in the future.