PUN Classic (v1), PUN 2 and Bolt are in maintenance mode. PUN 2 will support Unity 2019 to 2022, but no new features will be added. Of course all your PUN & Bolt projects will continue to work and run with the known performance in the future. For any upcoming or new projects: please switch to Photon Fusion or Quantum.

Bolt Singleton Prefab

Bolt includes a little helper class called BoltSingletonPrefab which is a basic pattern that allows easy global access and prevents the underlying prefab from being instantiated more than once. This class has nothing really to do with Bolt. It is implementing a very basic computer science design pattern. See https://www.geeksforgeeks.org/singleton-design-pattern/ for more details (keep in mind this article describes the basic pattern - implementations for Unity prefabs are necessarily different because of the way prefabs work). If you want to use a prefab singleton then you can just google “unity prefab singletons”, etc., and find many articles on the implementation of this pattern. Please do not feel like you must use the Bolt class - and since Bolt’s class is in a DLL it might be better to just implement your own following one of the many online articles so you both understand how it works and can modify it at will.

Back to top