PUN Classic (v1)、PUN 2 和 Bolt 處於維護模式。 PUN 2 將支援 Unity 2019 至 2022,但不會添加新功能。 當然,您所有的 PUN & Bolt 專案可以用已知性能繼續運行使用。 對於任何即將開始或新的專案:請切換到 Photon Fusion 或 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