Example code to use IPrefabPool?
Options
vellocet
✭
in Photon Bolt
Hi there,
I can't for the life of me figure out how to use IPrefabPool. The documentation seems to indicate how to set it up, but I can't find any information on how to actually populate the pool with objects, instantiate from the pool or return to pool on destroy. I can't even figure out how to access the Pool methods once I've BoltNetwork.SetPrefabPool(new PoolName()).
Can someone please point me in the right direction?
Thanks in advance!
I can't for the life of me figure out how to use IPrefabPool. The documentation seems to indicate how to set it up, but I can't find any information on how to actually populate the pool with objects, instantiate from the pool or return to pool on destroy. I can't even figure out how to access the Pool methods once I've BoltNetwork.SetPrefabPool(new PoolName()).
Can someone please point me in the right direction?
Thanks in advance!
0
Comments
-
https://doc.photonengine.com/en-us/bolt/current/community-wiki/Extra-Bits/Entity-Pooling
Example game using Bolt pooling
https://github.com/Reinisch/Warcraft-Arena-Unity0 -
Thanks for the response!
Honestly, I have been staring at that page that you linked forever and still can't figure it out. I'm going through the project that you linked now, but all I see is declarations for the pool.
If anyone can help with just something like how to declare the pool, initialize the pool (what does BoltNetwork.SetPrefabFool do?), instantiate from the pool (does BoltNetwork.Instantiate do it automatically?) and destroy to the pool, that would help a lot.
0