// Use this for initialization void Start() { // #if !UNITY_EDITOR if (PlayerPrefs.HasKey(hasMadePurchase)) { showAds = PlayerPrefs.GetInt(hasMadePurchase) == 0; } else { PlayerPrefs.SetInt(hasMadePurchase, 0); showAds = true; } if (PlayerPrefs.HasKey(numPlays)) { currentPlays = PlayerPrefs.GetInt(numPlays); } else { PlayerPrefs.SetInt(numPlays, 0); } if (showAds) { Admob.Instance().setTesting(true); InitAds(); } Debug.Log("\nSHOW ADS VALUE: " + showAds + "\n"); Debug.Log("\nHAS MADE PURCHASE: " + PlayerPrefs.GetInt(hasMadePurchase)); // #endif }
void Awake() { DontDestroyOnLoad(gameObject); #if UNITY_IOS appID = "ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID appID = "ca-app-pub-3940256099942544~3347511713"; bannerID = "ca-app-pub-3940256099942544/6300978111"; interstitialID = "ca-app-pub-3940256099942544/1033173712"; videoID = "ca-app-pub-3940256099942544/5224354917"; nativeBannerID = "ca-app-pub-3940256099942544/2247696110"; #endif AdProperties adProperties = new AdProperties(); //adProperties.isTesting = true; ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; //ad.initSDK(appID, adProperties);//reqired,adProperties can been null }
void initAdmob() { #if UNITY_IOS appID = "ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID appID = "ca-app-pub-3940256099942544~3347511713"; bannerID = "ca-app-pub-3940256099942544/6300978111"; interstitialID = "ca-app-pub-3940256099942544/6300978111"; videoID = "ca-app-pub-3940256099942544/5224354917"; nativeBannerID = "ca-app-pub-3940256099942544/2247696110"; #endif ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initSDK(appID); //optional ad.initAdmob(bannerID, interstitialID); //all id are admob test id,change those to your //ad.setTesting(true);//show test ad //ad.setNonPersonalized(true);//if want load NonPersonalized only,set true // ad.setIsDesignedForFamilies(true);//if is Is Designed For Families set true // ad.setGender(AdmobGender.MALE); // string[] keywords = { "game","crash","male game"}; // ad.setKeywords(keywords);//set keywords for ad Debug.Log("admob inited -------------" + appID); }
public void ShowBanner() { #if UNITY_EDITOR #elif UNITY_ANDROID Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.TOP_CENTER, 5); #endif }
public void Show_Banner_bot() { #if UNITY_EDITOR #elif UNITY_ANDROID Admob.Instance().showBannerRelative(AdSize.SmartBanner, AdPosition.BOTTOM_CENTER, 0); #endif }
public void ShowVideo() { #if UNITY_EDITOR #elif UNITY_ANDROID if (Admob.Instance().isInterstitialReady()) { Admob.Instance().showInterstitial(); } else { Admob.Instance().loadInterstitial(); } Admob.Instance().loadInterstitial(); #elif UNITY_IOS if (Admob.Instance().isInterstitialReady()) { Admob.Instance().showInterstitial(); } else { Admob.Instance().loadInterstitial(); } Admob.Instance().loadInterstitial(); #endif }
// Use this for initialization void Start() { game = GoogleGame.Instance(); game.gameEventHandler += onGameEvent; adFlag = true; audioSrce = GetComponent <AudioSource>(); highScore = PlayerPrefs.GetInt("highscore", highScore); gameTime = PlayerPrefs.GetInt("gameTime", (int)gameTime); swipeTime = PlayerPrefs.GetInt("swipeTime", swipeTime); isGameOver = false; ct = 0; timer = 30; sendingObject = ct; startPositionToSort = new Vector3(0, 1, 0); sendPosition = new Vector3(0, 1, 0); MakeList(); Sort(); sendingObject = ct; playAgainButton.active = false; homePageButton.active = false; resumeButton.active = false; initAdmob(); Admob.Instance().showBannerRelative(AdSize.SmartBanner, AdPosition.TOP_CENTER, 0); }
void initAdmob() { #if UNITY_IOS // appID="ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID //appID="ca-app-pub-3940256099942544~3347511713"; bannerID = "ca-app-pub-3940256099942544/6300978111"; interstitialID = "ca-app-pub-3940256099942544/1033173712"; videoID = "ca-app-pub-3940256099942544/5224354917"; nativeBannerID = "ca-app-pub-3940256099942544/2247696110"; #endif AdProperties adProperties = new AdProperties(); /* * adProperties.isTesting(true); * adProperties.isAppMuted(true); * adProperties.isUnderAgeOfConsent(false); * adProperties.appVolume(100); * adProperties.maxAdContentRating(AdProperties.maxAdContentRating_G); * string[] keywords = { "key1", "key2", "key3" }; * adProperties.keyworks(keywords); */ ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initSDK(adProperties); //reqired,adProperties can been null }
void initAdmob() { #if UNITY_IOS appID = "ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID appID = "ca-app-pub-3940256099942544~3347511713"; bannerID = "ca-app-pub-3940256099942544/6300978111"; interstitialID = "ca-app-pub-3940256099942544/1033173712"; videoID = "ca-app-pub-3940256099942544/5224354917"; nativeBannerID = "ca-app-pub-3940256099942544/2247696110"; #endif AdProperties adProperties = new AdProperties(); adProperties.isTesting = true; ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initSDK(appID, adProperties); //reqired,adProperties can been null FirebaseAnalytic firebase = FirebaseAnalytic.Instance(); //init and start analysis firebase.logEvent("startevent", "{\"player\":\"yingke\"}"); firebase.setUserId("232324432"); firebase.setUserProperty("age", "20"); firebase.setAnalyticsCollectionEnabled(true); }
void onBannerEvent(string eventName, string msg) { if (eventName == AdmobEvent.onAdLoaded) { Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 0); } }
void onRewardedVideoEvent(string eventName, string msg) { if (eventName == AdmobEvent.onAdClosed) { Admob.Instance().loadRewardedVideo(rewardedVideoID); } }
void initAdmob() { #if UNITY_IOS // appID="ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID appID = "ca-app-pub-3535705278798960~1140641020"; bannerID = "ca-app-pub-3535705278798960/8527450108"; //bannerID = "ca-app-pub-3940256099942544/6300978111"; #endif AdProperties adProperties = new AdProperties(); adProperties.isTesting(false); adProperties.isAppMuted(true); adProperties.isUnderAgeOfConsent(false); adProperties.appVolume(100); adProperties.maxAdContentRating(AdProperties.maxAdContentRating_G); string[] keywords = { "diagram", "league", "brambling" }; adProperties.keyworks(keywords); ad = Admob.Instance(); //ad.bannerEventHandler += onBannerEvent; //ad.interstitialEventHandler += onInterstitialEvent; //ad.rewardedVideoEventHandler += onRewardedVideoEvent; //ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initSDK(adProperties);//reqired,adProperties can been null }
public void ShowVideoAd() { if (Admob.Instance().isRewardedVideoReady()) { Admob.Instance().showRewardedVideo(); } }
public void ShowVideo() //This is the Interstitial ad function which needs to be and is being called in the { //whenever the panel is activated in the GameManager script and trajectoy script if (Admob.Instance().isInterstitialReady()) { Admob.Instance().showInterstitial(); } }
private void Awake() { #if UNITY_IOS // appID="ca-app-pub-3940256099942544~1458002511"; bannerID = "ca-app-pub-3940256099942544/2934735716"; interstitialID = "ca-app-pub-3940256099942544/4411468910"; videoID = "ca-app-pub-3940256099942544/1712485313"; nativeBannerID = "ca-app-pub-3940256099942544/3986624511"; #elif UNITY_ANDROID //appID="ca-app-pub-2971252247570492~7083194859"; bannerID = "ca-app-pub-2971252247570492/3459876129"; interstitialID = "ca-app-pub-2971252247570492/9123034835"; #endif AdProperties adProperties = new AdProperties(); adProperties.isTesting(false); adProperties.isAppMuted(true); adProperties.isUnderAgeOfConsent(false); adProperties.appVolume(100); adProperties.maxAdContentRating(AdProperties.maxAdContentRating_G); string[] keywords = { "diagram", "league", "brambling" }; adProperties.keyworks(keywords); ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.initSDK(adProperties);//reqired,adProperties can been null }
private void Start() { Instance = this; DontDestroyOnLoad(gameObject); Admob.Instance().initAdmob(bannerId, videoId); }
// Use this for initialization void Start() { Admob.Instance().initAdmob("ca-app-pub-4657780191765526/2145664895", "////"); Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 0); //tappx request }
//banner: ca-app-pub-2906510767249222/2074269594 //interstitial: ca-app-pub-2906510767249222/2353471190 // rewarded video: ca-app-pub-2906510767249222/6294034790 public static void RequestInterstitial() { if (!ProgressManager.GetProgress().proVersion) { Admob.Instance().loadInterstitial(); } }
void Start() { Admob.Instance().initAdmob("ca-app-pub-5188168190344391/6789555357", "ca-app-pub-5188168190344391/8011960468"); Admob.Instance().loadInterstitial(); Invoke("SetWinPosition", 1); }
private void Awake() { if (!started) { // Activate the Google Play Games platform PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().EnableSavedGames().Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); // initialize progress (replace by google save) ProgressManager.LoadProgressData(); // Initialize Ads Admob.Instance().initAdmob("ca-app-pub-2906510767249222/2074269594", "ca-app-pub-2906510767249222/2353471190");//admob id with format ca-app-pub-279xxxxxxxx/xxxxxxxx //Admob.Instance().setTesting(true); currentScene = ActiveScene.home; #if UNITY_ANDROID Social.localUser.Authenticate((bool success) => { }); #endif } if (_instance != null && _instance != this) { Destroy(this.gameObject); return; } _instance = this; DontDestroyOnLoad(this.gameObject); }
void initAdmob() { ad = Admob.Instance(); ad.interstitialEventHandler += onInterstitialEvent; ad.bannerEventHandler += onBannerEvent; ad.initAdmob("ca-app-pub-7657412837781109/5184954636", "ca-app-pub-7657412837781109/4023916208"); }
public void LoadInterstitial() { if (!Admob.Instance().isInterstitialReady()) { Admob.Instance().loadInterstitial(); } }
public void ShowIntrestial() { #if UNITY_EDITOR #elif UNITY_ANDROID Admob.Instance().showInterstitial(); #endif }
//bool isAdmobInited = false; void initAdmob() { string adUnitIdbaner; string adUnitIdfull; // isAdmobInited = true; #if UNITY_EDITOR adUnitIdbaner = "baner_Adr"; adUnitIdfull = "fullbaner_Adr"; #elif UNITY_ANDROID adUnitIdbaner = baner_Adr; adUnitIdfull = fullbaner_Adr; #elif UNITY_5 || UNITY_IOS || UNITY_IPHONE adUnitIdbaner = baner_IOS; adUnitIdfull = fullbaner_IOS; #else adUnitIdbaner = baner_Adr; adUnitIdfull = fullbaner_Adr; #endif // Create a 320x50 banner at the top of the screen. // bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Top); // bannerView.LoadAd(createAdRequest()); ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.nativeBannerEventHandler += onNativeBannerEvent; ad.initAdmob(adUnitIdbaner, adUnitIdfull); // ad.setTesting(true); Debug.Log("admob inited -------------"); }
public void Remove_Banner() { #if UNITY_EDITOR #elif UNITY_ANDROID Admob.Instance().removeAllBanner(); #endif }
// Use this for initialization void Awake() { Instance = this; DontDestroyOnLoad(gameObject); Admob.Instance().initAdmob(BanerId, VideoId);//"ca - app - pub - 5277642435008955 / 5406365428", "ca-app-pub-5277642435008955/5651700017"); Admob.Instance().loadInterstitial(); }
void Start() { Debug.Log("start unity demo-------------"); game = GoogleGame.Instance(); game.gameEventHandler += onGameEvent; Admob.Instance().initAdmob("ca-app-pub-3940256099942544/2934735716", "ca-app-pub-3940256099942544/4411468910"); }
public void ShowVideo() { if (Admob.Instance().isInterstitialReady()) { Admob.Instance().showInterstitial(); } }
public void ShowBanner() { if (Application.platform != RuntimePlatform.WindowsEditor) { Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 0); } }
/*******************admob ads *******************/ void initAdmob() { ad = Admob.Instance(); ad.bannerEventHandler += onBannerEvent; ad.interstitialEventHandler += onInterstitialEvent; ad.rewardedVideoEventHandler += onRewardedVideoEvent; ad.nativeBannerEventHandler += onNativeBannerEvent; //ad.setTesting(true); ad.initAdmob(admob_bannerID, admob_interstitialID_fy); //all id are admob test id,change those to your ad.loadInterstitial(); //ad.setTesting(true);//show test ad ad.setGender(AdmobGender.MALE); string[] keywords = { "game", "crash", "male game" }; // ad.setKeywords(keywords);//set keywords for ad Debug.Log("admob inited -------------"); // Admob.Instance().showBannerAbsolute(AdSize.Banner, 20, 300); //1111 if(PlayerPrefs.GetInt("noAds",0) != 1) // ad.showBannerRelative(new AdSize(220,50), AdPosition.TOP_CENTER,0); loadRewardAds(); }