In our demo project, we use one main class called GalaxyManager, as well as 7 other classes, which we refer to as feature classes. Each feature class represents a separate functionality of the GOG GALAXY SDK.
The feature classes are:
GalaxyManager contains definitions for the most basic GOG GALAXY SDK methods, which can be used even if the SDK was not fully initialized, such as
IsDLCInstalled(). It assigns its own instance to the
GalaxyManager.Instance static variable, which is accessible throughout the entire project. For ease of access, it initializes, terminates, and holds references to all feature classes.
Feature Class Structure¶
To improve the readability of the feature classes, we have structured them in accordance with a specific scheme outlined below — but this is completely optional.
In our scheme, every class is divided into 5 regions:
|Variables||Contains all variables defined in the class|
|Behaviors||Contains all MonoBehaviour methods used for script behaviour (e.g.
|Listener methods||Contains all methods related to listeners (in most cases, these are limited to methods, which initialize and terminate listeners)|
|Methods||Contains all methods related to the particular feature class|
|Listeners||Contains definitions of all listener classes related to the particular feature class|
At any point during the game, you can open Debug Menu by pressing F9. Debug Menu allows you to call many of the Galaxy SDK methods from anywhere in the game. The result of the call will be shown in the Console, which is also available from Debug Menu. The menu was created for testing and debugging purposes, and contains several sections:
|User||Allows you to monitor the current user’s status, which includes: ✔︎ checking if the SDK
|Apps||Allows you to call the
|Utils||Allows you to show a website with a provided URL in the GOG GALAXY Overlay and set users rich presence|
|Achievements||Allows you to set (unlock) game achievements by passing their apiKey, get the unlock statuses of achievements, as well as to reset all user statistics and achievements in the game|
|Statistics||Allows you to set values for all user statistics in game by calling the
|Leaderboards||Allows you to request different scopes of entries (global and near the user) for a particular leaderboard, as well as to set the user’s score on a particular leaderboard|
|Storage||Allows you to upload and download files from the GOG GALAXY Cloud Storage. The
|Game||Allows you to remove specific gameObjects (pool balls) from the scene to make the game easier, or to finish the game (yep, it’s cheating, but no one needs to know)|
|Arguments||Displays all arguments that were used to start the game|
|Console||Displays Unity debug logs on the screen|
- GOG GALAXY Client — our optional gaming client developed for easy access to games and goodies. Required for most of the GOG GALAXY SDK features to work.
- GOG GALAXY SDK — a set of libraries that allow you to implement the GOG GALAXY features in your games.
- GOG GALAXY Peer — a working instance of the GOG GALAXY SDK.