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.

To Document Top