void Start() { singleton = this; // bind button events CacheAdButton.Select(); CacheAdButton.onClick.AddListener(cacheAdClicked); ShowAdButton.onClick.AddListener(showAdClicked); BackButton.onClick.AddListener(backClicked); // make sure we don't init the same Ad twice if (created) { return; } created = true; // create add var desc = new InterstitialAdDesc(); // Global desc.Testing = true; desc.EventCallback = eventCallback; desc.UseClassicGUI = false; desc.GUIOverrideEnabled = false; desc.UnityUI_SortIndex = 1001; // WinRT (Windows 8.0 & 8.1) desc.WinRT_AdAPI = InterstitialAdAPIs.AdDuplex; // NOTE: If building for WP 8.1 or Universal targets this value is used. All other WinRT values or used for Win8 // NOTE: Currently no Win8 interstisial API are supported. // WP8 (Windows Phone 8.0 & 8.1) desc.WP8_AdAPI = InterstitialAdAPIs.AdMob; // NOTE: If building for WP 8.1 or Universal targets this value is NOT used (Use the WinRT value instead). All other WP8 values are still used for WP 8.0, 8.1 and Universal. desc.WP8_AdMob_UnitID = ""; // NOTE: Must set event for testing desc.WP8_AdDuplex_ApplicationKey = ""; // NOTE: Must set event for testing desc.WP8_AdDuplex_UnitID = ""; // NOTE: Must set event for testing // iOS desc.iOS_AdAPI = InterstitialAdAPIs.AdMob; desc.iOS_AdMob_UnitID = ""; // NOTE: Must set event for testing // Android #if AMAZON desc.Android_AdAPI = InterstitialAdAPIs.Amazon; #else desc.Android_AdAPI = InterstitialAdAPIs.AdMob; #endif desc.Android_AdMob_UnitID = ""; // NOTE: Must set event for testing desc.Android_Amazon_ApplicationKey = ""; // NOTE: Must set event for testing // create ad ad = InterstitialAdManager.CreateAd(desc, createdCallback); }
void Start() { // bind button events ShowAdButton.Select(); ShowAdButton.onClick.AddListener(showAdClicked); BackButton.onClick.AddListener(backClicked); // make sure we don't init the same Ad twice if (created) { return; } created = true; // create add var desc = new InterstitialAdDesc(); // Global desc.Testing = true; desc.EventCallback = eventCallback; desc.UseClassicGUI = false; desc.GUIOverrideEnabled = false; desc.UnityUI_SortIndex = 1001; // WP8 desc.WP8_AdAPI = InterstitialAdAPIs.AdMob; desc.WP8_AdMob_UnitID = ""; // NOTE: Must set event for testing // iOS desc.iOS_AdAPI = InterstitialAdAPIs.AdMob; desc.iOS_AdMob_UnitID = ""; // NOTE: Must set event for testing // Android #if AMAZON desc.Android_AdAPI = InterstitialAdAPIs.Amazon; #else desc.Android_AdAPI = InterstitialAdAPIs.AdMob; #endif desc.Android_AdMob_UnitID = ""; // NOTE: Must set event for testing desc.Android_Amazon_ApplicationKey = ""; // NOTE: Must set event for testing // create ad ad = InterstitialAdManager.CreateAd(desc, createdCallback); }