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 in your GameDistribution developer's control panel (in the 'Upload' tab), at developer.gamedistribution.com

  4. Open the prefab and replace the GAME_KEY value with your own key.

  5. Use GameDistribution.Instance.ShowAd() to show an advertisement.

  6. Use GameDistribution.Instance.ShowRewardedAd() to show a rewarded advertisement.

  7. Use GameDistribution.Instance.PreloadRewardedAd() to preload a rewarded advertisement

  8. Make use of the events GameDistribution.OnResumeGame and GameDistribution.OnPauseGame for resuming/pausing your game in between ads.

  9. Make use of the event GameDistribution.OnPreloadAd for checking the availability of rewarded advertisement after called GameDistribution.Instance.PreloadRewardedAd()

Example:

public class ExampleClass: MonoBehaviour {

    void Awake()
    {
        GameDistribution.OnResumeGame += OnResumeGame;
        GameDistribution.OnPauseGame += OnPauseGame;
        GameDistribution.OnPreloadAd += OnPreloadAd;
    }

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

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

    public void OnPreloadAd(int loaded)
    {
        // FEEDBACK ABOUT PRELOADING AD
        // 0: SDK couldn't preloaded ad
        // 1: SDK preloaded ad
    }

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

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

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

Important for Rewarded Ads

DO NOT FORGET TO CHECK REWARDED ADS FLAG on https://developer.gamedistribution.com for your game. Otherwise, your game is unable to request rewarded ads.

Best Practice for Rewarded Ads

You can use multiple ad slots for rewarded ads and give your players multiple way of gathering rewards. Samples below is very nice way of implementing this feature.

Also, check Superhero.io game to see how rewarded ads are implemented.

Let them watch an ad to increase their attacks!

No coin no pain? Oh, it is not. Let them gain some free coins.

Who doesn't want a second chance?

Your players can take their chances to gain some buffs!

You can give away some daily gifts to your players.