Unity Exitgames PUN pooling demo using SmartPool
This repository is a simple demo for integrating Pooling Systems and PUN.
Basically, you create a Component Script that implements IPunPrefabPool and feed instances using your preffered Pooling system: in our case, this is PunSmartPoolBridge.cs script.
You can conveniently download PunSmartPoolSample.unitypackage, if you don't want to clone this repository. You'll need to import PUN and SmartPool first.
- You need to keep your prefab inside a Resources folder anyway, It's important for PUN to load that prefab and analyze photonViews to assign viewIds. Note that there are no instantiation, it's only loaded
- On the Prefab instance, use OnPhotonInstantiate() to catch initialization, Start() and OnEnabled() are not suitable for reliable data across the various cases of instantiation and pool usage accross the network.
Knowing this, that's about it really...