Set Up the Unity SDK #
In this section, we’ll be generating a Unity SDK package, importing it into our project, and completing the initial configuration.
Prepare the setup script #
- Copy the setup script (
update-pragma-sdk.sh) frompragma-engine/sdk/unityinto the root directory of your Unity project.
- Open
update-pragma-sdk.shand modify it as follows:
- Uncomment
SOURCE_ENGINE_GITHUB_REPO. - Change the value of
SOURCE_ENGINE_GITHUB_REPOto point to your Pragma Engine repo. - Uncomment
TARGET_PRAGMA_SDK_DIR. - Change the path to
"Assets/PragmaSDK".
Run
update-pragma-sdk.shin Git Bash. Confirm that thePragmaSDKfolder now exists in yourAssetsdirectory.Open your Unity project in Unity Editor.
Create a “
Pragma.json” file in your project’sAssetsfolder using File Explorer.Replace the contents of
Pragma.jsonand save. It should appear at the bottom of the Unity window in the project area:{ "backendAddress": "http://127.0.0.1:10000", "protocolType": "WebSocket", "gameClientVersion": 1 }Game servers need to connect to the Partner (10100) port over HTTP. These requirements are enforced by the
Pragma.Serversession object.From the File menu, choose Build Settings…, then click the Player Settings button.
Expand Other Settings, then scroll to the Script Compilation section. Under Scripting Define Symbols click the + button and add
PRAGMA_LOG_VERBOSE, then click Apply. This enables full payload logging of all messages to and from the engine.
Additional setup is required for Unity 2022.1 and newer. Please see the following directions.





