Exemple #1
0
    /// <summary>
    /// Shows adds depends on currentAdsType
    /// </summary>
    public static void showAds()
    {
        switch (currentAdsType)
        {
        case AdsType.HeyzApp:
            if (isHeyzappInited)
            {
                if (HZInterstitialAd.isAvailable())
                {
                    HZInterstitialAd.show();
                }
            }
            else
            {
                Debug.LogWarning("AdsManager: init Heyzapp from showAds");
                initInterstitial();
            }

            break;

        case AdsType.AdMob:
            if (interstitial != null)
            {
                if (interstitial.IsLoaded())
                {
                    interstitial.Show();
                }
            }
            else
            {
                Debug.LogError("AdsManager: admob not inited");
            }

            break;
        }
    }
Exemple #2
0
 void Start()
 {
     // Your Publisher ID is: 73b1a9ddfd9ccc624275f5258d2ed465
     HeyzapAds.start("73b1a9ddfd9ccc624275f5258d2ed465", HeyzapAds.FLAG_NO_OPTIONS);
     HZInterstitialAd.show();
 }
Exemple #3
0
 public void ShowInterstitialAd()
 {
     HZInterstitialAd.show();
 }
Exemple #4
0
    public void GameOver()
    {
        GameData.isComingFromGameOverStore = true;
        Main.Instance.gameCount++;
        Main.Instance.sessionGameCount++;
        PlayerPrefs.SetInt(Constants.KEY_TOTAL_GAMES, Main.Instance.gameCount);
        Main.Instance.totalScoreOfSession += gameScore;
//		Debug.Log("GameOver");

        if (hudPanel.gameObject.activeSelf)
        {
            hudPanel.gameObject.SetActive(false);
        }



        if (!gameOverPanel.gameObject.activeSelf)
        {
            if (HZIncentivizedAd.isAvailable())
            {
                rewardButton.gameObject.SetActive(true);
            }
            else
            {
                rewardButton.gameObject.SetActive(false);
            }
            rewardConfirmImg.gameObject.SetActive(false);

            gameOverScoreText.text = "" + gameScore;
            if (gameScore > bestScore)
            {
                bestScore = gameScore;
                Main.Instance.PlayBestScoreSound();
                newBestText.gameObject.SetActive(true);
                PlayerPrefs.SetInt(Constants.KEY_BEST, bestScore);
                bestScoreText.text = "" + bestScore;
            }
            else
            {
//				Main.Instance.PlayGameOverSound();
                newBestText.gameObject.SetActive(false);
                bestScoreText.text = "" + bestScore;
            }

            //Add total eggs
            if (gameScore > 0)
            {
                Main.Instance.totalEggs += gameScore;
                PlayerPrefs.SetInt(Constants.KEY_TOTAL_EGGS, Main.Instance.totalEggs);

                GameData.lifeTimeEggs += gameScore;
                PlayerPrefs.SetInt(Constants.KEY_LIFE_TIME_EGGS, GameData.lifeTimeEggs);
            }

            totalEggs.text = "" + Main.Instance.totalEggs;


            if (Main.Instance.isNoAdsPurchased)
            {
                if (noAddButtonGameOver != null)
                {
                    noAddButtonGameOver.interactable = false;
                }
            }

            //Save Data
            PlayerPrefs.Flush();

            Main.Instance.PostScoreToLeaderBoard(gameScore);
//			gameOverInstText.text = GameData.gameOverInstructionText;
            gameOverPanel.gameObject.SetActive(true);


            if (!tutorialReplay.gameObject.activeSelf)
            {
                tutorialReplay.gameObject.SetActive(true);
            }
        }

        CheckForQuests();

        if (Main.Instance.gameCount > 1 && Main.Instance.gameCount % 3 == 0)
        {
            if (!Main.Instance.isNoAdsPurchased)
            {
                HZInterstitialAd.show();

                                #if UNITY_IOS
                AppTrackerIOS.loadModule("inapp");
                                #endif
            }
        }

        UniRate.Instance.LogEvent(true);
    }
Exemple #5
0
 /* Show interstitial ad (whichever ad was requested from mediation network) using tag */
 private void ShowInterstitial(string tag)
 {
     HZInterstitialAd.show(tag);
 }