This page serves only as a reference and should not be used for first time integrations. Instead, please use:

DRM – Unity Integration


DRM – Unity Integration

Document Revision: 6th November 2020

Regular Integration:

1. Download and include our DLL with the game:

2. Take our example Unity script:

3. Create an empty gameObject and assign the script to it.

4. Select the gameObject and assign the game id (integer) to SynthesisVR Game ID

5. Build the game

Important: set the build’s Architecture option to x86_64

6. Upload the build on SynthesisVR CDN (link)

← Back


(optional) Additional PPP billing functionalities:

For games whose billing is based on PPP (Pay Per Play), it is important to be able to end the current session without actually restarting the game. For that purpose, along with the default Unity integration (svr.li/producer/unity), it is important to also call the ResetBillingSession(“[gameid]“) functionality. Example code:

Note – it isn’t necessary to call ResetBillingSession for the billing to start. This is needed only when the session is restarted and a new game is to be played from the beginning. Also, ResetBillingSession isn’t needed with the PPM and fixed fee billing options.
 

(optional) Adding a JSON record to leaderboard:

  • string synthesisGameId = “00000”;
  • ArcadeInterface svrInterface = ArcadeFactory.Synthesis();
  • svrInterface.Init(synthesisGameId);
  • var success = svrInterface.AddToLeaderboard(<JSON_AS_STRING>)

(optional) Session end:

The Synthesis software controls the lifespan of your game executable. When the pre-paid user time is over (=session end), Synthesis will kill your game. This gives you no option to perform some final actions like peacefully end the user experience and encourage them to get back for another play session. Also, you wont have any time to record any final leaderboard data.

When applicable and for a better user experience, we suggest regularly check how much time the user has. If it is between 1 to 30 seconds, end the gameplay, display a nice message, log the leaderboard data, and let Synthesis end the exe. To check how much seconds the user still have, use the following call: