Path: blob/main/misc/smashkarts/scripts/ads-adsbygoogle-v2.js
36008 views
'use strict';12function requestMainMenuBanner()3{4if(!isMobile())5{6aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_300x250')});7}8}910function requestWinCeremonyBanner(interstialRequested)11{12if(!isMobile())13{14aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_300x250_2')});15}16}171819function requestLongBanner()20{21if(!isMobile())22{23//aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_728x90')});24aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_970x250')});25}26else27{28//aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_320x100')});29}30}3132function showInterstitial(unusedParam, interstitialType, interstitialName)33{34// var audioOnStr = audioOn ? 'on' : 'off';35// adConfig({36// sound: audioOnStr,37// });3839if(adBreak != null)40{41adBreak({4243type: interstitialType, // ad shows at start of next level44name: interstitialName,45beforeBreak: interstitialStart,46afterBreak: interstitialComplete47});48}49}505152var onShowRewardedVideoClicked = null;5354function tryInitRewardedInterstitial(unusedParam)55{56if(adBreak != null)57{58adBreak({59type: 'reward', // The type of this placement60name: 'rewardedxpboost', // A descriptive name for this placement61beforeAd: () => {interstitialStart();}, // Prepare for the ad. Mute and pause the game flow62afterAd: () => {console.log("tryInitRewardedInterstitials afterAd");}, // Resume the game and re-enable sound63beforeReward: (showAdFn) => { console.log("set onShowRewardedVideoClicked"); rewardedInterstitialAvailable(); onShowRewardedVideoClicked = showAdFn }, // Show reward prompt (call showAdFn() if clicked)64adDismissed: () => {interstitialSkipped();}, // Player dismissed the ad before it finished.65adViewed: () => {interstitialComplete();}, // Player watched the ad–give them the reward.66adBreakDone: (placementInfo) => {console.log("tryInitRewardedInterstitials adBreakDone");}, // Always called (if provided) even if an ad didn’t show67});68}69}7071function tryShowRewardedInterstitial(unusedParam)72{73if(onShowRewardedVideoClicked != null)74{75onShowRewardedVideoClicked();76}77}7879function rewardedInterstitialAvailable()80{81window.unityGame.SendMessage(unityFirebaseGameOjbectName, "RewardedInterstitialAvailable");82}838485