Exemple #1
0
    public void RunAppLovinAd(AdType type)
    {
        switch (type)
        {
        case AdType.Interstitial:
            if (AppLovin.HasPreloadedInterstitial())
            {
                AppLovin.ShowInterstitial();
            }
            break;

        case AdType.Rewarded:
            if (AppLovin.IsIncentInterstitialReady())
            {
                AppLovin.ShowRewardedInterstitial();
            }
            break;

        case AdType.Banner:
            throw new System.NotImplementedException("Applovin does't have type of Banner.");

        default:
            throw new System.NotImplementedException("Unknown type.");
        }
    }
    public void ShowInterstitial()
    {
        Log("Showing interstitial ad");

        // Optional: You can call `AppLovin.PreloadInterstitial()` and listen to the "LOADED" event to preload the ad from the network before showing it
        AppLovin.ShowInterstitial();
    }
 public void ShowInterstitialAd()
 {
     if (AppLovin.HasPreloadedInterstitial())
     {
         AppLovin.ShowInterstitial();
     }
 }
    public void GameOverEvent(int score)
    {
        // Showing without using PreloadInterstitial
        AppLovin.ShowInterstitial();

        // Showing utilizing PreloadInterstitial and HasPreloadedInterstitial
        if (AppLovin.HasPreloadedInterstitial())
        {
            // An ad is currently available, so show the interstitial.
            AppLovin.ShowInterstitial();
        }
        else
        {
            // No ad is available.  Perform failover logic...
        }
        // GameAnalytics.NewProgressionEvent(GAProgressionStatus.Complete, "game", score);

        var param = new Dictionary <string, object>();

        param[AppEventParameterName.ContentID] = "game";
        param[AppEventParameterName.Success]   = "0";

        FB.LogAppEvent(
            AppEventName.CompletedRegistration,
            parameters: param
            );
    }
Exemple #5
0
    IEnumerator waitAfterDead()
    {
        ballForwardSpeed = 0;
        ballJumpSpeed    = 0;

        if (gameObject.GetComponent <Renderer>().material.color == myMaterials[0].color)
        {
            Instantiate(afterDeathRed, new Vector3(transform.position.x,
                                                   transform.position.y + .5f,
                                                   transform.position.z), transform.rotation);
        }
        if (gameObject.GetComponent <Renderer>().material.color == myMaterials[1].color)
        {
            Instantiate(afterDeathGreen, new Vector3(transform.position.x,
                                                     transform.position.y + .5f,
                                                     transform.position.z), transform.rotation);
        }
        if (gameObject.GetComponent <Renderer>().material.color == myMaterials[2].color)
        {
            Instantiate(afterDeathBlue, new Vector3(transform.position.x,
                                                    transform.position.y + .5f,
                                                    transform.position.z), transform.rotation);
        }



        gameObject.GetComponent <MeshRenderer>().enabled = false;
        Debug.Log("Start");

        //ad
        if (numOfPlay % 4 == 0)
        {
            if (PlayerPrefs.GetInt("IsPurchased", 0) == 0)
            {
                if (AppLovin.HasPreloadedInterstitial())
                {
                    AppLovin.ShowInterstitial();
                }
            }
        }

        GameObject.Find("DontDestroy").GetComponent <AudioSource>().volume = 0.8f;
        yield return(new WaitForSeconds(0.2f));

        GameObject.Find("DontDestroy").GetComponent <AudioSource>().volume = 0.5f;
        yield return(new WaitForSeconds(0.2f));

        GameObject.Find("DontDestroy").GetComponent <AudioSource>().volume = 0.3f;
        yield return(new WaitForSeconds(0.2f));

        GameObject.Find("DontDestroy").GetComponent <AudioSource>().volume = 0.05f;
        GameObject.Find("DontDestroy").GetComponent <SetDontDestroyOnLoad>().PlayRandomMusic();

        yield return(new WaitForSeconds(1.0f));

        Debug.Log("end");

        GoToRandomStage();
    }
Exemple #6
0
 void ShowInterstitial(Action OnInterClosed)
 {
     if (!AdsRemoved)
     {
         this.OnInterClosed = OnInterClosed;
         AppLovin.ShowInterstitial();
     }
 }
Exemple #7
0
 public void Show()
 {
     Debug.Log("HasPreloadedInterstitial:" + AppLovin.HasPreloadedInterstitial());
     if (AppLovin.HasPreloadedInterstitial())
     {
         AppLovin.ShowInterstitial();
     }
 }
 /// <summary>
 /// Show AppLovin interstitial
 /// </summary>
 /// <param name="InterstitialClosed">callback called when user closes interstitial also containing the provider of the closed interstitial</param>
 public void ShowInterstitial(UnityAction <string> InterstitialClosed)
 {
     if (IsInterstitialAvailable())
     {
         OnInterstitialClosedWithAdvertiser = InterstitialClosed;
         AppLovin.ShowInterstitial();
     }
 }
 /// <summary>
 /// Show AppLovin interstitial
 /// </summary>
 /// <param name="InterstitialClosed">callback called when user closes interstitial</param>
 public void ShowInterstitial(UnityAction InterstitialClosed)
 {
     if (IsInterstitialAvailable())
     {
         OnInterstitialClosed = InterstitialClosed;
         AppLovin.ShowInterstitial();
     }
 }
Exemple #10
0
        public bool ShowInterstitial()
        {
            Debug.Log("show applovin ads intertitial");
#if !UNITY_EDITOR
            AppLovin.ShowInterstitial();
#endif
            return(true);
        }
 public void ShowInterstitial()
 {
     if (AppLovin.HasPreloadedInterstitial())
     {
         AppLovin.ShowInterstitial();
     }
     else
     {
         LoadInsterstitial();
     }
 }
 public void ShowInterstitial()
 {
     //Debug.Log("XXXXX Inside Show Interstitial");
     if (AppLovin.HasPreloadedInterstitial())
     {
         //Debug.Log("XXXXX Calling AppLoving Show Interstitial");
         AppLovin.ShowInterstitial();
     }
     else
     {
         //Debug.Log("XXXXX Calling Load Interstitial");
         LoadInterstitial();
     }
 }
Exemple #13
0
 public void ShowAd()
 {
     //HideBanner ();
     games_count++;
     count += ScoreManager.instance.CurrentScore;
     if (games_count >= 4 && count >= 300 && AppLovin.HasPreloadedInterstitial())
     {
         Time.timeScale = 0f;
         AppLovin.ShowInterstitial();
         Time.timeScale = 1f;
         count          = 0;
         games_count    = 0;
     }
 }
    public bool ShowInterstitial()
    {
        if (!AppLovin.HasPreloadedInterstitial())
        {
            AppLovin.PreloadInterstitial();
        }
        else
        {
            AppLovin.ShowInterstitial();
            return(true);
        }

        return(false);
    }
    // Token: 0x06000DD8 RID: 3544 RVA: 0x0005845C File Offset: 0x0005685C
    public void ShowAd(string zone = "rewardedVideo")
    {
        ShowOptions showOptions = new ShowOptions();

        showOptions.resultCallback = new Action <ShowResult>(this.AdCallbackhanler);
        if (Advertisement.isReady(zone))
        {
            Advertisement.Show(zone, showOptions);
        }
        else if (AppLovin.HasPreloadedInterstitial(null))
        {
            AppLovin.ShowInterstitial();
            this.ifVideoWatched();
        }
    }
Exemple #16
0
 // Token: 0x06000CBE RID: 3262 RVA: 0x00050508 File Offset: 0x0004E908
 public void Exiitscreen()
 {
     this.Play_ButtonClickSound();
     if (Application.platform == RuntimePlatform.Android && !Application.isEditor)
     {
         if (AppLovin.HasPreloadedInterstitial(null))
         {
             AppLovin.ShowInterstitial();
         }
         else if (Admob.Instance().isInterstitialReady())
         {
             Admob.Instance().showInterstitial();
         }
     }
     this.exitscreen.enabled = true;
 }
Exemple #17
0
    public static void showAppLovinFullScreenAd()
    {
        if (SSAdInitializer.AppLovinStaticFlag)
        {
            AppLovin.ShowInterstitial();

            //Tempory until callback functions available
            adHasShownFlag       = true;
            activateInterstitial = false;
            failCounter          = 0;

            showingGameOver = false;
            showingOnLoad   = false;
            showingPause    = false;
            showingReturn   = false;
        }
    }
Exemple #18
0
    public void EndGame()
    {
        if (PlayerPrefs.GetInt("GameAdsCount", 0) >= 3)
        {
            if (AppLovin.HasPreloadedInterstitial())
            {
                PlayerPrefs.SetInt("GameAdsCount", 0);
                AppLovin.ShowInterstitial();
            }
        }
        GameAnalytics.NewProgressionEvent(GAProgressionStatus.Complete, "game", SpaceShipController.instance.score);
        ShowEndScreen();

        SaveScore();
        LoadScore();
        InGameUI.SetActive(false);
        EndGameUI.SetActive(true);
        HighScoreTxt2.text = HighScoreTxt.text;
        ScoreTxt2.text     = ScoreTxt.text;
    }
Exemple #19
0
 // Start is called before the first frame update
 void Start()
 {
     if (txtLevel != null)
     {
         txtLevel.text = "" + (level);
     }
     if (txtNextLevel != null)
     {
         level             = PlayerPrefs.GetInt("Level");
         txtNextLevel.text = "" + (level + 1);
         if (AppLovin.HasPreloadedInterstitial())
         {
             // An ad is currently available, so show the interstitial.
             AppLovin.ShowInterstitial();
         }
         else
         {
             // No ad is available.  Perform failover logic...
         }
         LogLevel_achievedEvent(level + 1, 0);
     }
 }
Exemple #20
0
        protected override void InternalShowInterstitialAd(AdPlacement placement)
        {
#if EM_APPLOVIN
            string id = placement == AdPlacement.Default ?
                        mAdSettings.DefaultInterstitialAdId.Id :
                        FindIdForPlacement(mAdSettings.CustomInterstitialAdIds, placement);

            if (placement.Equals(AdPlacement.Default)) // Default interstitial ad...
            {
                if (string.IsNullOrEmpty(id))
                {
                    AppLovin.ShowInterstitial();
                }
                else
                {
                    AppLovin.ShowInterstitialForZoneId(id);
                }

                currentShowingInterstitial = placement;
            }
            else // Custom interstitial ad...
            {
                if (!mCustomInterstitialAds.Contains(placement))
                {
                    return;
                }
                if (string.IsNullOrEmpty(id))
                {
                    AppLovin.ShowInterstitial();
                }
                else
                {
                    AppLovin.ShowInterstitialForZoneId(id);
                }
                currentShowingInterstitial = placement;
            }
#endif
        }
Exemple #21
0
    void PlayerDiedEndTheGame()
    {
        if (!PlayerPrefs.HasKey("Score"))
        {
            PlayerPrefs.SetInt("Score", 0);
        }
        else
        {
            int highscore = PlayerPrefs.GetInt("Score");

            if (highscore < score)
            {
                PlayerPrefs.SetInt("Score", score);
            }
        }
        AdsController.instance.deaths++;
        AppLovin.PreloadInterstitial();

        pauseText.text = "Game Over";
        pausePanel.SetActive(true);
        restartGameButton.onClick.RemoveAllListeners();
        restartGameButton.onClick.AddListener(() => RestartGame());
        Time.timeScale = 0f;

        if (AdsController.instance.deaths % 3 == 0)
        {
            if (AppLovin.HasPreloadedInterstitial())
            {
                AppLovin.ShowInterstitial();
            }
            else
            {
                AdsController.instance.deaths--;
            }
        }
    }