GameBreak
How to set up
- Download the responsiveWebGL template and import it into your project: ResponsiveWebGL Template
- When building for WebGL, use the Y8 template y8Responsive
To show Ads
- Download the assets folder containing the required files.
- Copy AfgbetaJs.jslib, AfgbetaJs.cs, and main.cs into your project.
- Create a new GameObject named GameObjectAds. Add components to include the AfgbetaJs.cs and main.cs scripts. Use the following functions for ads:
- showAd() Call to show ads.
- showRewardAd() Call to show rewarded ads.
- pauseGame() Pause the game.
- resumeGame() Resume the game.
- rewardAdsCompleted() Trigger rewards after completing an ad.
- NoRewardedAdsTryLater() Call if no rewarded ads are available.
- rewardAdsCanceled() Trigger if the user cancels the rewarded ad.
- Locate the responsiveWebGL template folder, Find gameBreakBeta.js and drag and drop it into the editor.
- If you are an AFP partner, replace the AdSense ID in the code
- var AdsenseId = “YOUR_ADSENSE_ID”;
- set activateAFP to true (var activateAFP = true;)
- If you are not an AFP partner, replace the Channel ID
- var ChannelId = “YOUR_CHANNEL_ID”;
- Set activateAFP to false (var activateAFP = false;) Contact us if you want to become an AFP partner or if you need a Channel ID.
- Set testAdsOn to false when the game is ready to go live (var testAdsOn = false;)