Advertising


While any Unity compatible advertising framework can be used with Game Framework, additional support is provided for both Unity Ads and Google Mobile Ads / AdMob.

AdMob

AdMod usage requires that you first install and setup the Google Mobile Ads Unity Plugin. You will then need to enable Game Framework integration with AdMob through the Menu | Windows| Game Framework | Integration Window.

AdvertisingIntegration

The simplest way to use AdMob is to add an instance of the AdMobManager component to your scene (recommended onto a _GameScope gameobject). Within AdMobManager you can configure your advert Unit ID’s and any parameters for targeting and styling your adverts. You can then show adverts in one of 2 ways.

AdMobManager

The ShowHideAdvert component will automatically try and show an advert when the scene to which it is added is loaded and hide the advert when the scene exits.

ShowHideAdvert

Through code you can also easily show and hide ads as you need through the the methods on AdMobManager e.g.

AdMob adverts can optionally persist across multiple scenes so you can also show in one scene and hide in another. You may also instantiate and setup an instance of the Game Framework AdMob class directly if you want further control.

See also API Documentation

UnityAds

Unity Ads provides great and easy integration of adverts out of the box. When you have this setup in your project the extra features in Game Framework will automatically become available.

At the most basic level, the ShowAdvert component can be used to automatically try and show an advert when the scene to which it is added is loaded.

One of the most used forms of getting people to watch adverts is to give some form of reward. Game Framework provides functionality to reward the user with coins when they watch an advert. The UnityAds class provides the static ShowWatchAdvertForCoins(int coins) method that will display an advert and then reward the user with the given number of coins if they watch the advert.

WatchForCoins

The component OnButtonClickWatchAdvertForCoins can be added to any gameobject that contains a UI Button to automatically hooks up the button with the ShowWatchAdvertForCoins call mentioned above.

See also

If you have any thoughts or suggestions on improvements or additions to the Advertising features then please let us know!