I have some very heavy loading times on mobile. On iOS it can take up to 7 seconds on a iPhone 7 or SE, while on Android it takes up to 30 seconds on slower devices. Seems the more prefabs I pool the longer the loading time for my initial scene.
I asked this in another thread, but I think there is no way of loading only the prefabs that are needed for the current level and then behind the scenes load the rest. Right?
So you are saying that for prefabs not being loaded at the opening of the game (which I guess is before the first scene is loaded), I would need to put those in the Resource folder and do an Asset Bundle or Addressables?
I'm completely new to this and don't really get what would be the best approach in order to load lots of prefabs with Pool Boss and would appreciate if you could point me towards it. Right now I'm having all prefabs inside the Asset folder and am just loading them at Start all together with PoolBoss. Which I understand adds them immediately to the pool hence they are referenced from the beginning and therefore loaded at game open?
Pool Boss does that for you. You don't need to write any code. You must make sure and set the "Prefab Source" field to "Resource file" when you create the Pool Item. It won't automatically know that it's a Resource.
Post by DarkTonic Dev on Apr 24, 2021 16:03:48 GMT
Sorry, I just checked and you're right. There is no Resource File option. Only Addressables. The field will appear if you install the Addressables package and enable Pool Boss Addressables support with the checkbox on the Welcome Window. Then you need to make your own Addressables packages, for which there's a lot of info online.
If you don't want to do that, just use prefabs as you are doing now.
Anyway, the answer is to not load all prefabs for the entire game into Pool Boss, but use Pool Mini-Boss for each level's prefabs.
Can a prefab be in PoolBoss and not be instantiated on Start? Because seems when I put it to zero it won't spawn (doesn't allow to instantiate more). Is there a method for it that is the opposite to PoolBoss.DestroyPoolItem? PoolBoss.InstantiatePoolItem maybe?