-
Notifications
You must be signed in to change notification settings - Fork 7
Home
Alessandro Latella edited this page Feb 27, 2019
·
27 revisions
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].
- Import the .unitypackage into your game.
- Drag the prefab "GameDistribution" into your scene.
- Copy your GAME_KEY and USER_ID (<-deprecated) in your GameDistribution developer's control panel (in the 'Upload' tab), at developer.gamedistribution.com
- Open the prefab and replace the GAME_KEY and USER_ID (<- deprecated) values with your own keys.
- Use GameDistribution.Instance.ShowAd() to show an advertisement.
- Make use of the events
GameDistribution.OnResumeGame
andGameDistribution.OnPauseGame
for resuming/pausing your game in between ads.
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();
}
}