make sure that there is only one instance of GalaxyManager running at all times: the Instance is only assigned if its current value is null if the Instance is already assigned, we destroy the extra instance of GalaxyManager.create Instance, which is a static reference to GalaxyManager class, for easier access from outside of the class,.add DontDestroyOnLoad() flag to the GameObject this script is attached to,.
When the GameObject is created, the Awake() Event function is called. Then we add a GalaxyManager script component to that GameObject. To ensure that all requirements listed in the previous section are met, we take advantage of the MonoBehaviour Event Functions execution order.įirst, we create a GameObject called GalaxyManager in Unity Editor, in the first game scene. When the application is closed, GalaxyManager should make sure that all listeners are closed and GalaxyInstance is shut down. It should be initialized at the very start of the game and present for the entire duration of the game session. It inherits from the MonoBehaviour superclass.
GalaxyManager is a central class managing all of the GOG GALAXY features. Lobby Management In Game: Examples of Implementation Lobby Management in Main Menu: Examples of Implementation Lobby Browsing: Examples of Implementation Lobby Creation: Examples of Implementation Stats and Achievements: Example of Implementation Importing Achievements Using the Steam VDF File User Authentication Based On Other ServicesĪuthorizing GOG GALAXY Users in Third-Party Services Preparing Depots for macOS Application Bundle Our Recommendations for macOS Game Structure