예제 #1
0
    //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 -------------");
    }
예제 #2
0
 // AdRequest adRequestBanner = null;
 void MakeInstance()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
예제 #3
0
        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);
        }
예제 #4
0
 public void LoadInterstitial()
 {
     if (!Admob.Instance().isInterstitialReady())
     {
         Admob.Instance().loadInterstitial();
     }
 }
예제 #5
0
    private void Start()
    {
        Instance = this;
        DontDestroyOnLoad(gameObject);

        Admob.Instance().initAdmob(bannerId, videoId);
    }
예제 #6
0
 //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();
     }
 }
예제 #7
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;

        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);
    }
예제 #8
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
    }
예제 #9
0
 void onRewardedVideoEvent(string eventName, string msg)
 {
     if (eventName == AdmobEvent.onAdClosed)
     {
         Admob.Instance().loadRewardedVideo(rewardedVideoID);
     }
 }
예제 #10
0
 // 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();
 }
예제 #11
0
    void Start()
    {
        admob = gameObject.GetComponent <Admob>();
        //((PlayGamesPlatform)Social.Active).Authenticate((bool success) => { }, true);

        /*
         * Social.localUser.Authenticate((bool success) => {
         *   // handle success or failure
         * });
         */
        colorAmarillo   = temaPista.color;
        totalMarcador   = 0;
        marcador.text   = "Puntos: " + totalMarcador.ToString("D2");
        particle        = sparks.GetComponent <ParticleSystem>();
        animDesordenada = desordenada.GetComponent <Animator>();
        animTemaPista   = temaPista.GetComponent <Animator>();
        totalMonedas    = 10;
        monedas.text    = totalMonedas.ToString();
        CargaContenido();
        print("CargaContenido");
        timeTotal  = 120;
        timeWord   = 10;
        timeMoneda = 5;
        CargaArrayFinal();
        print("CargaArrayFinal");
        mueve = GetComponent <MueveLetras>();
        Elige();
        print("Elige");

        //EligePalabra();
    }
예제 #12
0
 public void ShowBanner()
 {
             #if UNITY_EDITOR
             #elif UNITY_ANDROID
     Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 5);
             #endif
 }
예제 #13
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-2971252247570492~7083194859";
        bannerID       = "ca-app-pub-2971252247570492/3459876129";
        interstitialID = "ca-app-pub-2971252247570492/9123034835";
        videoID        = "ca-app-pub-3940256099942544/5224354917";
        nativeBannerID = "ca-app-pub-3940256099942544/2247696110";
#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
    }
예제 #14
0
    public static void ShowAd()
    {
#if UNITY_ANDROID
        if (!SaveGame.showAds())
        {
            return;
        }

        if (!Admob.Instance().isInterstitialReady())
        {
            Admob.Instance().loadInterstitial();
            return;
        }

        if (GameManager.level < 11)
        {
            return;
        }

        if (GameManager.level % 2 == 0)
        {
            return;
        }

        if (Admob.Instance().isInterstitialReady())
        {
            Admob.Instance().showInterstitial();
            Admob.Instance().loadInterstitial();
        }
#endif
    }
예제 #15
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/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);
    }
예제 #16
0
 public void ShowBanner()
 {
     if (Application.platform != RuntimePlatform.WindowsEditor)
     {
         Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 0);
     }
 }
예제 #17
0
    // 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
    }
 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");
 }
예제 #19
0
    public void ShowIntrestial()
    {
#if UNITY_EDITOR
#elif UNITY_ANDROID
        Admob.Instance().showInterstitial();
#endif
    }
    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
    }
예제 #21
0
    // 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);
    }
예제 #22
0
 void initAdmob()
 {
     ad = Admob.Instance();
     ad.interstitialEventHandler += onInterstitialEvent;
     ad.bannerEventHandler       += onBannerEvent;
     ad.initAdmob("ca-app-pub-7657412837781109/5184954636", "ca-app-pub-7657412837781109/4023916208");
 }
예제 #23
0
    void Start()
    {
        Admob.Instance().initAdmob("ca-app-pub-5188168190344391/6789555357", "ca-app-pub-5188168190344391/8011960468");
        Admob.Instance().loadInterstitial();

        Invoke("SetWinPosition", 1);
    }
예제 #24
0
 void onBannerEvent(string eventName, string msg)
 {
     if (eventName == AdmobEvent.onAdLoaded)
     {
         Admob.Instance().showBannerRelative(AdSize.Banner, AdPosition.BOTTOM_CENTER, 0);
     }
 }
예제 #25
0
    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
    }
예제 #26
0
    public static void Init()
    {
#if UNITY_ANDROID
        Admob.Instance().initAdmob("", "insert_admob_id");
        Admob.Instance().loadInterstitial();
#endif
    }
예제 #27
0
    public void Show_Banner_top()
    {
#if UNITY_EDITOR
#elif UNITY_ANDROID
        Admob.Instance().showBannerRelative(AdSize.SmartBanner, AdPosition.TOP_CENTER, 0);
#endif
    }
예제 #28
0
 public void ShowVideo()
 {
     if (Admob.Instance().isInterstitialReady())
     {
         Admob.Instance().showInterstitial();
     }
 }
예제 #29
0
    public void Remove_Banner()
    {
#if UNITY_EDITOR
#elif UNITY_ANDROID
        Admob.Instance().removeAllBanner();
#endif
    }
예제 #30
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-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
    }
예제 #31
0
 //bool isAdmobInited = false;
 void initAdmob()
 {
     
       //  isAdmobInited = true;
          ad = Admob.Instance();
         ad.bannerEventHandler += onBannerEvent;
         ad.interstitialEventHandler += onInterstitialEvent;
         ad.rewardedVideoEventHandler += onRewardedVideoEvent;
         ad.nativeBannerEventHandler += onNativeBannerEvent;
         ad.initAdmob("ca-app-pub-3940256099942544/2934735716", "ca-app-pub-3940256099942544/4411468910");
         //   ad.setTesting(true);
         Debug.Log("admob inited -------------");
     
 }