Unity Ad Extension
This extension will help you to integrate Unity Ads in your MIT AI2 applications.
Get Started :
As this first extension has been discontinued, I've created unity ads extension with latest 4.4.0 library. First of all, you should paste your game id at designer property of the extension or use SetGameId
block to set your game id then you have to use Initialize block to initialze sdk, if it is sucessfully initialized then only you are allowed to use other blocks.
-
Initialize
You must call this method to initialize the required SDKs. On Successful, It will trigger the eventInitializationComplete
else it will triggerInitializationFailed
event.
I suggest you call this method onScreen1.initalize
. Also, if you initialize this extension on Screen1 then it is no longer a need to initialize on other screens. -
InitializationComplete
This block will be triggered when sdk is sucessfully initialized. Now you can show ads on your app. -
InitializationFailed
This block will be triggered on failure of initialization of sdk. You can retry initialization by usingInitialize
function block.
Interstitial & Rewarded Ads
To show interstitial or rewarded ads then you have to load it first using LoadInterstitialAd
or LoadRewardedAd
method by providing adUnitId(also called as placement id). If sucessfully loaded then it will trigger AdLoaded
event with adUnitId. If failed to load then it will trigger AdFailedToLoad
event with adUnitId and error message.
After Ad is sucessfully loaded, you can now show that ad using ShowInterstitialAd
or ShowRewardedAd
method. On ad sucessfully started, it will trigger AdShowStarted
event, if failed then it will trigger AdShowFailed
event , if ad is clicked then it will call AdShowClicked
event, if ad is completed then it will trigger AdShowCompleted
method and if ad is skipped then it will trigger AdShowSkipped
event.
Banner Ad
You should first load banner ad using LoadBannerAd
method which need params adUnitId & size. You can give a custom size, dynamic size or normal size(320*50) in size param. After banner is loaded, it will trigger BannerLoaded
event with adUnitId. If failed then it will trigger BannerFailedToLoad
event. To show banner ad, you should provide a horizontal arrangement on which banner ad can lie with ShowBannerAd
method.
Downloads :
Download Latest Version Of Extension From Github
This extension is open-source at