Esempio n. 1
0
    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
            );
    }
 public void ShowInterstitialAd()
 {
     if (AppLovin.HasPreloadedInterstitial())
     {
         AppLovin.ShowInterstitial();
     }
 }
Esempio n. 3
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.");
        }
    }
Esempio n. 4
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();
    }
Esempio n. 5
0
 public void Show()
 {
     Debug.Log("HasPreloadedInterstitial:" + AppLovin.HasPreloadedInterstitial());
     if (AppLovin.HasPreloadedInterstitial())
     {
         AppLovin.ShowInterstitial();
     }
 }
Esempio n. 6
0
 public void ShowInterstitial()
 {
     if (AppLovin.HasPreloadedInterstitial())
     {
         AppLovin.ShowInterstitial();
     }
     else
     {
         LoadInsterstitial();
     }
 }
    public bool ShowInterstitial()
    {
        if (!AppLovin.HasPreloadedInterstitial())
        {
            AppLovin.PreloadInterstitial();
        }
        else
        {
            AppLovin.ShowInterstitial();
            return(true);
        }

        return(false);
    }
Esempio n. 8
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 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();
     }
 }
    public bool InterstitialIsReady() // if readey inter
    {
        var result = AppLovin.HasPreloadedInterstitial();

        if (result)
        {
        }
        else
        {
            AppLovin.PreloadInterstitial();
        }

        return(result);
    }
    // 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();
        }
    }
Esempio n. 12
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;
 }
Esempio n. 13
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;
    }
Esempio n. 14
0
        //------------------------------------------------------------
        // Interstitial Ads.
        //------------------------------------------------------------

        protected override bool InternalIsInterstitialAdReady(AdPlacement placement)
        {
#if EM_APPLOVIN
            string id = placement == AdPlacement.Default ?
                        mAdSettings.DefaultInterstitialAdId.Id :
                        FindIdForPlacement(mAdSettings.CustomInterstitialAdIds, placement);

            if (placement == AdPlacement.Default) // Default interstitial ad...
            {
                if (string.IsNullOrEmpty(id))
                {
                    return(AppLovin.HasPreloadedInterstitial());
                }
                else
                {
                    return(AppLovin.HasPreloadedInterstitial(mAdSettings.DefaultInterstitialAdId.Id));
                }
            }
            else // Custom interstitial ad...
            {
                if (mCustomInterstitialAds != null &&
                    mCustomInterstitialAds.Contains(placement))
                {
                    if (string.IsNullOrEmpty(id))
                    {
                        return(AppLovin.HasPreloadedInterstitial());
                    }
                    else
                    {
                        return(AppLovin.HasPreloadedInterstitial(id));
                    }
                }
                else
                {
                    return(false);
                }
            }
#else
            return(false);
#endif
        }
Esempio n. 15
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);
     }
 }
Esempio n. 16
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--;
            }
        }
    }
Esempio n. 17
0
 /// <summary>
 /// Check if AppLovin interstitial is available
 /// </summary>
 /// <returns>true if an interstitial is available</returns>
 public bool IsInterstitialAvailable()
 {
     return(AppLovin.HasPreloadedInterstitial());
 }