public void ShowBanner()
    {
#if UNITY_ANDROID || UNITY_IPHONE
        AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_BOTTOM);
        AppsFlyerManager.Instance.TrackBannerAppLovinView();
#endif
    }
Ejemplo n.º 2
0
 public static void showAppLovinBanner()
 {
     if (SSAdInitializer.AppLovinStaticFlag)
     {
         AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_BOTTOM);
     }
 }
Ejemplo n.º 3
0
    void Start()
    {
        AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_BOTTOM);
        StartCoroutine(ExecuteAfterTime(0.1f));
        startTimer         = 3.2f;
        gameTimer          = 30f;
        scoreNum           = 0;
        scoreTemp          = 0;
        coin.sortingOrder  = -1;
        net.sortingOrder   = -2;
        scoreText.text     = PlayerPrefs.GetInt("TimeScore", 0).ToString();
        moveNet            = true;
        highscoreMusic     = true;
        highscoreText.text = PlayerPrefs.GetInt("TimeChallengeScore", 0).ToString();
        coins                = PlayerPrefs.GetInt("Coins");
        coinsText.text       = PlayerPrefs.GetInt("Coins", 0).ToString();
        height               = Camera.main.orthographicSize * 2.0f;
        width                = height * Screen.width / Screen.height;
        netWidth             = barMover.bounds.size.x;
        goalSource.clip      = goalSound;
        loseSource.clip      = loseSound;
        coinSource.clip      = coinSound;
        highscoreSource.clip = highscoreSound;
        Button retryBtn = retry.GetComponent <Button>();

        retry.onClick.AddListener(RetryBtnClick);
        Button mainMenuBtn = mainMenu.GetComponent <Button>();

        mainMenu.onClick.AddListener(MainMenuBtnClick);
    }
    IEnumerator CallAds()
    {
        yield return(StartCoroutine(MyCoroutine.WaitForRealSeconds(3f)));

        LoadInterstitial();
        LoadVideo();
        AppLovin.ShowAd(AppLovin.AD_POSITION_TOP, AppLovin.AD_POSITION_CENTER);
    }
Ejemplo n.º 5
0
    public void SetAdsCount()
    {
        int Count = PlayerPrefs.GetInt("GameAdsCount", 0);

        Count += 1;
        PlayerPrefs.SetInt("GameAdsCount", Count);
        AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_BOTTOM);
    }
Ejemplo n.º 6
0
    IEnumerator CallAds()
    {
        yield return(new WaitForSecondsRealtime(3f));

        LoadInterstitial();
        LoadVideo();

        AppLovin.ShowAd(AppLovin.AD_POSITION_TOP, AppLovin.AD_POSITION_CENTER);
    }
Ejemplo n.º 7
0
 void ShowBanner()
 {
     Debug.Log("banner1");
     if (!AdsRemoved)
     {
         Debug.Log("banner2");
         AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_BOTTOM);
     }
 }
Ejemplo n.º 8
0
        //------------------------------------------------------------
        // Banner Ads.
        //------------------------------------------------------------

        protected override void InternalShowBannerAd(AdPlacement placement, BannerAdPosition position, BannerAdSize size)
        {
#if EM_APPLOVIN
            string id = placement == AdPlacement.Default ?
                        mAdSettings.DefaultBannerAdId.Id :
                        FindIdForPlacement(mAdSettings.CustomBannerAdIds, placement);

            if (placement.Equals(AdPlacement.Default)) // Default banner...
            {
                /// Create a new banner if user request a
                /// banner ad with different position or size.
                if (position != mDefaultBannerPosition)
                {
                    Debug.Log("Creating new default banner...");
                    mDefaultBannerPosition = position;
                }
                AppLovinAdPosition pos = ToAppLovinAdPosition(position);
                AppLovin.SetAdPosition(pos.x, pos.y);
                if (string.IsNullOrEmpty(id))
                {
                    AppLovin.ShowAd();
                }
                else
                {
                    AppLovin.ShowAd(id);
                }
            }
            else // Custom banner...
            {
                /// Create a new banner if the banner with this key hasn't been initialized or
                /// user request new banner with existed key but different position or size.
                bool shouldCreateFlag = !mCustomBanners.ContainsKey(placement) ||
                                        mCustomBanners[placement].Key != position ||
                                        mCustomBanners[placement].Value != size;

                if (shouldCreateFlag)
                {
                    Debug.Log("Creating new custom banner...");
                    mCustomBanners[placement] = new KeyValuePair <BannerAdPosition, BannerAdSize>(position, size);
                }

                AppLovinAdPosition pos = ToAppLovinAdPosition(position);
                AppLovin.SetAdPosition(pos.x, pos.y);
                if (string.IsNullOrEmpty(id))
                {
                    AppLovin.ShowAd();
                }
                else
                {
                    AppLovin.ShowAd(id);
                }
            }
#endif
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Show AppLovin banner
        /// </summary>
        /// <param name="position">can be TOP of BOTTOM</param>
        /// <param name="bannerType">it is not used in AppLovin, this param is used just in Admob implementation</param>
        public void ShowBanner(BannerPosition position, BannerType bannerType, UnityAction <bool, BannerPosition, BannerType> DisplayResult)
        {
            bannerUsed         = true;
            this.position      = position;
            this.bannerType    = bannerType;
            this.DisplayResult = DisplayResult;

            if (position == BannerPosition.BOTTOM)
            {
                AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_BOTTOM);
            }
            else
            {
                AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_TOP);
            }
        }
Ejemplo n.º 10
0
 void Start()
 {
     AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_BOTTOM);
     StartCoroutine(ExecuteAfterTime(0.1f));
     coin.sortingOrder = -1;
     net.sortingOrder  = -2;
     if (PlayerPrefs.GetInt("HighscoreLevel") < 10)
     {
         num  = 0;
         temp = 0;
     }
     if (PlayerPrefs.GetInt("HighscoreLevel") >= 10)
     {
         num  = 10;
         temp = 10;
     }
     if (PlayerPrefs.GetInt("HighscoreLevel") >= 20)
     {
         num  = 20;
         temp = 20;
     }
     if (PlayerPrefs.GetInt("HighscoreLevel") >= 30)
     {
         num  = 30;
         temp = 30;
     }
     if (PlayerPrefs.GetInt("HighscoreLevel") >= 40)
     {
         num  = 40;
         temp = 40;
     }
     moveNet            = true;
     highscoreMusic     = true;
     scoreText.text     = PlayerPrefs.GetInt("Score", 0).ToString();
     highscoreText.text = PlayerPrefs.GetInt("Highscore", 0).ToString();
     levelText.text     = PlayerPrefs.GetInt("Level", 1).ToString();
     coins             = PlayerPrefs.GetInt("Coins");
     coinsText.text    = PlayerPrefs.GetInt("Coins", 0).ToString();
     MusicSource.clip  = MusicClip;
     MusicSource2.clip = MusicClip2;
     MusicSource3.clip = MusicClip3;
     MusicSource4.clip = MusicClip4;
     MusicSource5.clip = MusicClip5;
     height            = Camera.main.orthographicSize * 2.0f;
     width             = height * Screen.width / Screen.height;
     netWidth          = barMover.bounds.size.x;
 }
Ejemplo n.º 11
0
 void Start()
 {
     AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_BOTTOM);
     StartCoroutine(ExecuteAfterTime(0.1f));
     scoreNum           = 0;
     scoreTemp          = 0;
     coin.sortingOrder  = -1;
     net.sortingOrder   = -2;
     scoreText.text     = PlayerPrefs.GetInt("HardScore", 0).ToString();
     moveNet            = true;
     highscoreMusic     = true;
     highscoreText.text = PlayerPrefs.GetInt("HardModeScore", 0).ToString();
     coins                = PlayerPrefs.GetInt("Coins");
     coinsText.text       = PlayerPrefs.GetInt("Coins", 0).ToString();
     height               = Camera.main.orthographicSize * 2.0f;
     width                = height * Screen.width / Screen.height;
     netWidth             = barMover.bounds.size.x;
     goalSource.clip      = goalSound;
     loseSource.clip      = loseSound;
     coinSource.clip      = coinSound;
     highscoreSource.clip = highscoreSound;
     InvokeRepeating("ChangeSpeed", 1.5f, 1f);
 }
Ejemplo n.º 12
0
 /**
  * Loads and displays the AppLovin banner ad at given position
  *
  * @param {float} x  Horizontal position of the ad (AD_POSITION_LEFT, AD_POSITION_CENTER, AD_POSITION_RIGHT) or float
  * @param {float} y  Vertical position of the ad (AD_POSITION_TOP, AD_POSITION_BOTTOM) or float
  */
 public static void ShowAd(float x, float y)
 {
     AppLovin.SetAdPosition(x, y);
     AppLovin.ShowAd();
 }
Ejemplo n.º 13
0
 public void ShowBanner()
 {
     Log("Showing banner ad");
     AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_BOTTOM);
 }
Ejemplo n.º 14
0
    void Start()
    {
        #if UNITY_ANDROID
        freeCoins.gameObject.SetActive(false);
        #elif UNITY_IPHONE
        #endif
        AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_BOTTOM);

        numSkins = 5;

        balls    = new Sprite[numSkins];
        balls[0] = basketBall;
        balls[1] = tennisBall;
        balls[2] = soccerBall;
        balls[3] = bowlingBall;
        balls[4] = volleyBall;

        nets    = new Sprite[numSkins];
        nets[0] = netOne;
        nets[1] = netTwo;
        nets[2] = netThree;
        nets[3] = netFour;
        nets[4] = netFive;

        floors    = new Sprite[numSkins];
        floors[0] = floorOne;
        floors[1] = floorTwo;
        floors[2] = floorThree;
        floors[3] = floorFour;
        floors[4] = floorFive;

        ballColor        = new Color[numSkins];
        basketBallColor  = new Color32(222, 101, 5, 255);
        tennisBallColor  = new Color32(224, 254, 107, 255);
        soccerBallColor  = new Color32(255, 255, 255, 255);
        bowlingBallColor = new Color32(12, 78, 154, 255);
        volleyBallColor  = new Color32(234, 237, 221, 255);
        ballColor[0]     = basketBallColor;
        ballColor[1]     = tennisBallColor;
        ballColor[2]     = soccerBallColor;
        ballColor[3]     = bowlingBallColor;
        ballColor[4]     = volleyBallColor;

        purchasedBall    = new bool[numSkins];
        purchasedBall[0] = basketBallPurchased;
        purchasedBall[1] = tennisBallPurchased;
        purchasedBall[2] = soccerBallPurchased;
        purchasedBall[3] = bowlingBallPurchased;
        purchasedBall[4] = volleyBallPurchased;

        purchasedNet    = new bool[numSkins];
        purchasedNet[0] = netOnePurchased;
        purchasedNet[1] = netTwoPurchased;
        purchasedNet[2] = netThreePurchased;
        purchasedNet[3] = netFourPurchased;
        purchasedNet[4] = netFivePurchased;

        purchasedFloor    = new bool[numSkins];
        purchasedFloor[0] = floorOnePurchased;
        purchasedFloor[1] = floorTwoPurchased;
        purchasedFloor[2] = floorThreePurchased;
        purchasedFloor[3] = floorFourPurchased;
        purchasedFloor[4] = floorFivePurchased;

        selectedBall    = new bool[numSkins];
        selectedBall[0] = basketBallSelected;
        selectedBall[1] = tennisBallSelected;
        selectedBall[2] = soccerBallSelected;
        selectedBall[3] = bowlingBallSelected;
        selectedBall[4] = volleyBallSelected;

        selectedNet    = new bool[numSkins];
        selectedNet[0] = netOneSelected;
        selectedNet[1] = netTwoSelected;
        selectedNet[2] = netThreeSelected;
        selectedNet[3] = netFourSelected;
        selectedNet[4] = netFiveSelected;

        selectedFloor    = new bool[numSkins];
        selectedFloor[0] = floorOneSelected;
        selectedFloor[1] = floorTwoSelected;
        selectedFloor[2] = floorThreeSelected;
        selectedFloor[3] = floorFourSelected;
        selectedFloor[4] = floorFiveSelected;

        ballIndex  = PlayerPrefs.GetInt("CurrentBall");
        netIndex   = PlayerPrefs.GetInt("CurrentNet");
        floorIndex = PlayerPrefs.GetInt("CurrentFloor");
        purchasedBall[ballIndex]   = true;
        selectedBall[ballIndex]    = true;
        purchasedNet[netIndex]     = true;
        selectedNet[netIndex]      = true;
        purchasedFloor[floorIndex] = true;
        selectedFloor[floorIndex]  = true;
        purchasedBalls             = PlayerPrefs.GetInt("BallAvailability");
        purchasedNets   = PlayerPrefs.GetInt("NetAvailability");
        purchasedFloors = PlayerPrefs.GetInt("FloorAvailability");

        Button backBtn = back.GetComponent <Button>();
        back.onClick.AddListener(BackButtonClick);
        Button nextBallBtn = nextBall.GetComponent <Button>();
        nextBall.onClick.AddListener(NextBallButtonClick);
        Button previousBallBtn = previousBall.GetComponent <Button>();
        previousBall.onClick.AddListener(PreviousBallButtonClick);
        Button purchaseBallBtn = purchaseBall.GetComponent <Button>();
        purchaseBall.onClick.AddListener(PurchaseBallButtonClick);
        Button selectBallBtn = selectBall.GetComponent <Button>();
        selectBall.onClick.AddListener(SelectBallButtonClick);
        Button nextNetBtn = nextNet.GetComponent <Button>();
        nextNet.onClick.AddListener(NextNetButtonClick);
        Button previousNetBtn = previousNet.GetComponent <Button>();
        previousNet.onClick.AddListener(PreviousNetButtonClick);
        Button purchaseNetBtn = purchaseNet.GetComponent <Button>();
        purchaseNet.onClick.AddListener(PurchaseNetButtonClick);
        Button selectNetBtn = selectNet.GetComponent <Button>();
        selectNet.onClick.AddListener(SelectNetButtonClick);
        Button nextFloorBtn = nextFloor.GetComponent <Button>();
        nextFloor.onClick.AddListener(NextFloorButtonClick);
        Button previousFloorBtn = previousFloor.GetComponent <Button>();
        previousFloor.onClick.AddListener(PreviousFloorButtonClick);
        Button purchaseFloorBtn = purchaseFloor.GetComponent <Button>();
        purchaseFloor.onClick.AddListener(PurchaseFloorButtonClick);
        Button selectFloorBtn = selectFloor.GetComponent <Button>();
        selectFloor.onClick.AddListener(SelectFloorButtonClick);

        Button freeCoinsBtn = freeCoins.GetComponent <Button>();
        freeCoins.onClick.AddListener(FreeCoinsButtonClick);
    }
Ejemplo n.º 15
0
    void Start()
    {
        #if UNITY_ANDROID
        #elif UNITY_IPHONE
        AppLovin.SetSdkKey("blT3W15rTlQhPKkcarKUZZ46toGIC1vDT62aVhQucHACCSDo7xaRPFVtAHpG5sE6SsB2pu8xHmxy6OFnFvth2s");
        #endif
        AppLovin.InitializeSdk();
        AppLovin.SetUnityAdListener("AppLovinListener");
        AppLovin.ShowAd(AppLovin.AD_POSITION_CENTER, AppLovin.AD_POSITION_BOTTOM);
        AppLovin.LoadRewardedInterstitial();

        if (PlayerPrefs.HasKey("BallAvailability") && PlayerPrefs.HasKey("NetAvailability") && PlayerPrefs.HasKey("FloorAvailability"))
        {
        }
        else
        {
            PlayerPrefs.SetInt("BallAvailability", 1);
            PlayerPrefs.SetInt("NetAvailability", 1);
            PlayerPrefs.SetInt("FloorAvailability", 1);
        }

        ballSkins    = new Sprite[5];
        ballSkins[0] = basketBall;
        ballSkins[1] = tennisBall;
        ballSkins[2] = soccerBall;
        ballSkins[3] = bowlingBall;
        ballSkins[4] = volleyBall;
        ball.sprite  = ballSkins[PlayerPrefs.GetInt("CurrentBall")];

        netSkins    = new Sprite[5];
        netSkins[0] = netOne;
        netSkins[1] = netTwo;
        netSkins[2] = netThree;
        netSkins[3] = netFour;
        netSkins[4] = netFive;
        net.sprite  = netSkins[PlayerPrefs.GetInt("CurrentNet")];

        floorSkins     = new Sprite[5];
        floorSkins[0]  = floorOne;
        floorSkins[1]  = floorTwo;
        floorSkins[2]  = floorThree;
        floorSkins[3]  = floorFour;
        floorSkins[4]  = floorFive;
        floor.sprite   = floorSkins[PlayerPrefs.GetInt("CurrentFloor")];
        Time.timeScale = 1;
        Button playBtn = play.GetComponent <Button>();
        playBtn.onClick.AddListener(PlayButtonClick);

        Button leaderboardBtn = leaderboard.GetComponent <Button>();
        leaderboardBtn.onClick.AddListener(LeaderboardButtonClick);

        Button rateBtn = rate.GetComponent <Button>();
        rateBtn.onClick.AddListener(RateButtonClick);

        Button classicBtn = classic.GetComponent <Button>();
        classic.onClick.AddListener(ClassicButtonClick);

        Button timeBtn = time.GetComponent <Button>();
        time.onClick.AddListener(TimeButtonClick);

        Button hardBtn = hard.GetComponent <Button>();
        hard.onClick.AddListener(HardButtonClick);

        Button backBtn = back.GetComponent <Button>();
        back.onClick.AddListener(BackButtonClick);

        Button customizeBtn = customize.GetComponent <Button>();
        customize.onClick.AddListener(CustomizeButtonClick);

#if UNITY_ANDROID
        leaderboardBtn.gameObject.SetActive(false);
#elif UNITY_IPHONE
        Social.localUser.Authenticate(ProcessAuthentication);
#endif
    }