The repository containing the GameDistribution SDK for Unity (WebGL) games. This allows you to display advertisements and other solutions available to games published within the GameDistribution network.
Switch branches/tags
Nothing to show
Clone or download

README.md

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 support@gamedistribution.com

Implementation within games

  1. Import the .unitypackage into your game.
  2. Drag the prefab "GameDistribution" into your scene.
  3. Replace the GAME_KEY and USER_ID values with your own keys.
  4. Use GameDistribution.Instance.ShowAd() to show an advertisement.
  5. 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();	
	}
}