Unity

Connect your game with our SDKs

GitHub version license

Gamedistribution.com Unity HTML5 SDK plugin

This is the documentation of the "Gamedistribution.com Unity HTML5 SDK plugin" project for adding the SDK within your Unity WebGL game.

Gamedistribution.com is the biggest broker of high quality, cross-platform games. We connect the best game developers to the biggest publishers.

Running into any issues?

Check out the F.A.Q. within the Wiki of the github repository before mailing to [email protected].

Implementation within games

  1. Download and import the .unitypackage into your game (download here).
  2. Drag the prefab "GameDistribution" into your scene.
  3. Copy your GAME_KEY and USER_ID (<-deprecated) in your GameDistribution developer's control panel (in the 'Upload' tab), at developer.gamedistribution.com
  4. Open the prefab and replace the GAME_KEY and USER_ID (<- deprecated) values with your own keys.
  5. Use GameDistribution.Instance.ShowAd() to show an advertisement.
  6. Make use of the events GameDistribution.OnResumeGame and GameDistribution.OnPauseGame for resuming/pausing your game in between ads.

Example:

public class ExampleClass: MonoBehaviour {
    void Awake()
    {
      GameDistribution.OnResumeGame += ResumeGame;
      GameDistribution.OnPauseGame += PauseGame;
    }

    void OnDestroy()
    {
      GameDistribution.OnResumeGame -= ResumeGame;
      GameDistribution.OnPauseGame -= PauseGame;
    }

    public void ResumeGame()
    {
      // RESUME MY GAME
    }

    public void PauseGame()
    {
      // PAUSE MY GAME
    }

    public void ShowAd()
    {
      GameDistribution.Instance.ShowAd();    
    }
}