public void GetShards() { if (HZIncentivizedAd.IsAvailable()) { HZIncentivizedAd.Show(); PlayerPrefs.SetInt("currentShards", PlayerPrefs.GetInt("currentShards") + 5); MoreShards.SetActive(false); MapPanel.SetActive(true); } }
public void ShowRewardAd() { if (HZIncentivizedAd.IsAvailable()) { Toaster.ShowDebugToast("Showing reward ad."); HZIncentivizedAd.Show(); } else { Toaster.ShowDebugToast("Can't show reward ad"); } }
public void ShowIncentivezedAds() { if (HZIncentivizedAd.IsAvailable()) { HZIncentivizedAd.Show(); ShowIncentiveAds(); } else { HZIncentivizedAd.Fetch(); UnityAdsController.instance.ShowUnityRewardedAd(); } }
private void ShowRewarded() { // Later, such as after a level is completed if (HZIncentivizedAd.IsAvailable("rewarded")) { HZIncentivizedShowOptions showOptions = new HZIncentivizedShowOptions(); showOptions.Tag = "rewarded"; HZIncentivizedAd.ShowWithOptions(showOptions); Defs.MuteSounds(true); VideoAdCointer = 0; } }
public void ShowRewardedAd(AdLocation location) { #if EM_HEYZAP if (HZIncentivizedAd.IsAvailable()) { HZIncentivizedAd.Show(); } else { Debug.Log("Could not show Heyzap rewarded ad: ad is not loaded."); } #else Debug.LogError(NO_SDK_MESSAGE); #endif }
public void ShowRewardAd(string tag) { if (HZIncentivizedAd.IsAvailable(tag)) { Toaster.ShowDebugToast("Showing reward video for tag; " + tag); HZIncentivizedShowOptions options = new HZIncentivizedShowOptions(); options.Tag = tag; HZIncentivizedAd.ShowWithOptions(options); } else { Toaster.ShowDebugToast("Can't show reward video for tag; " + tag); } }
public void WatchVideo() { if (GameData.isMusicON) { MainDriver.Instance.PlayButtonSound(); } if (MainDriver.Instance.shallShowVideo) { if (HZIncentivizedAd.IsAvailable()) { HZIncentivizedAd.Show(); } } }
protected override bool InternalIsRewardedAdReady(AdPlacement placement) { #if EM_HEYZAP if (placement == AdPlacement.Default) { return(HZIncentivizedAd.IsAvailable()); } else { return(HZIncentivizedAd.IsAvailable(ToHeyzapAdTag(placement))); } #else return(false); #endif }
void HandleVideoTimerFinished() { timerText.gameObject.SetActive(false); if (HZIncentivizedAd.IsAvailable()) { rewardBtn.gameObject.SetActive(true); rewardText.text = "WATCH VIDEO GET 3 DIAMONDS"; } else if (!HZIncentivizedAd.IsAvailable()) { rewardBtn.gameObject.SetActive(false); timerText.gameObject.SetActive(false); rewardText.gameObject.SetActive(false); } }
public void ShowIncentivezedAd() { if (HZIncentivizedAd.IsAvailable() && AdChecker) { AdChecker = false; HZIncentivizedAd.Show(); } else if (AdChecker) { AdChecker = false; HZIncentivizedAd.Fetch(); UnityAdsController.instance.ShowUnityRewardedAd(); } ShowIncentiveAds(); }
public void x2VideoButtonHandler() { if (!x2VideoButtonPressed) { if (HZIncentivizedAd.IsAvailable()) { oneGameMoney *= 2; gameOverMoney.text = oneGameMoney.ToString(); x2VideoButtonPressed = true; HZIncentivizedAd.Show(); } else { } } }
public void RewardedWepSlot(int slot) { #if UNITY_EDITOR saveData.AwardSlot(slot); #endif #if UNITY_ANDROID if (HZIncentivizedAd.IsAvailable()) { HZIncentivizedAd.Show(); Analytics.CustomEvent("SlotVideo"); saveData.AwardSlot(slot); } HZIncentivizedAd.Fetch(); #endif }
public void DiamondTab() { if (unlockPanel.gameObject.activeSelf) { unlockPanel.gameObject.SetActive(false); return; } if (noDiamondPanel.gameObject.activeSelf) { noDiamondPanel.gameObject.SetActive(false); return; } if (!diamondTab.gameObject.activeSelf) { if (GameData.isMusicON) { MainDriver.Instance.PlayButtonSound(); } int currentDiamonds = MainDriver.Instance.currentDiamondCnt; diamondCount.text = "" + currentDiamonds; themesTab.gameObject.SetActive(false); achivementTab.gameObject.SetActive(false); diamondTab.gameObject.SetActive(true); themeBtnBg.GetComponent <Outline>().effectColor = unselectColor; achvBtnBg.GetComponent <Outline>().effectColor = unselectColor; diamongBtnBg.GetComponent <Outline>().effectColor = selectedColor; if (HZIncentivizedAd.IsAvailable() && MainDriver.Instance.shallShowVideo) { rewardBtn.gameObject.SetActive(true); rewardText.text = "WATCH VIDEO GET 3 DIAMONDS"; } else if (HZIncentivizedAd.IsAvailable() && !MainDriver.Instance.shallShowVideo) { timerText.gameObject.SetActive(true); rewardBtn.gameObject.SetActive(false); rewardText.text = "VIDEO WILL BE AVAILABLE SOON"; } else if (!HZIncentivizedAd.IsAvailable()) { rewardBtn.gameObject.SetActive(false); timerText.gameObject.SetActive(false); rewardText.gameObject.SetActive(false); } } }
public void showHZAdVideos() { googleAnalytics.LogEvent(new EventHitBuilder() .SetEventCategory("game_action") .SetEventAction("heyzap_advideos") .SetEventLabel("video")); if (HZIncentivizedAd.IsAvailable()) { HZIncentivizedAd.Show(); } HZIncentivizedAd.Fetch(); // // Later, such as after a level is completed // if (HZVideoAd.IsAvailable()) { // HZVideoAd.Show(); // HZVideoAd.Fetch(); // } }
public void RewardedAmmo() { #if UNITY_EDITOR weapons.giveAmmo(weapons.weaponToAddAmmo); pause.DeactivateAmmoCanvas(); fpsPlayerRef.ActivateADShield(3.0f); #endif #if UNITY_ANDROID if (HZIncentivizedAd.IsAvailable()) { HZIncentivizedAd.Show(); weapons.giveAmmo(weapons.weaponToAddAmmo); Analytics.CustomEvent("AmmoVideo"); pause.DeactivateAmmoCanvas(); fpsPlayerRef.ActivateADShield(3.0f); HZIncentivizedAd.Fetch(); } #endif }
public override bool IsAvilable(AdsElement type) { if (!AdsController.NoAds) { switch (type.type) { case AdsType.Interstitial: HZInterstitialAd.IsAvailable(type.name); break; case AdsType.Video: HZVideoAd.IsAvailable(type.name); break; case AdsType.RewardedVideo: HZIncentivizedAd.IsAvailable(type.name); break; } } return(false); }
public void BuyMap() { if (!PlayerPrefs.HasKey(currentMapVariable)) { if (PlayerPrefs.GetInt("currentShards") >= 10) { PlayerPrefs.SetInt("currentShards", PlayerPrefs.GetInt("currentShards") - 10); MapPanel.SetActive(false); Map.gameObject.SetActive(true); PlayerPrefs.SetInt(currentMapVariable, 1); } else { if (HZIncentivizedAd.IsAvailable()) { MapPanel.SetActive(false); MoreShards.SetActive(true); } } } }
public void Rewarded() { #if UNITY_EDITOR fpsPlayerRef.hitPoints = fpsPlayerRef.maximumHitPoints; fpsPlayerRef.UpdateHPBar(); fpsPlayerRef.invulnerable = true; if (resetPositionInDeath) { fpsPlayerTransform.position = originalPosition; fpsPlayerTransform.rotation = originalRotation; resetPositionInDeath = false; } pause.DeactivateDeathCanvas(); fpsPlayerRef.RemoveInvulnerability(); fpsPlayerRef.ActivateADShield(5.0f); #endif #if UNITY_ANDROID if (HZIncentivizedAd.IsAvailable()) { HZIncentivizedAd.Show(); fpsPlayerRef.invulnerable = true; fpsPlayerRef.hitPoints = fpsPlayerRef.maximumHitPoints; fpsPlayerRef.UpdateHPBar(); Analytics.CustomEvent("DeathVideo"); if (resetPositionInDeath) { fpsPlayerTransform.position = originalPosition; fpsPlayerTransform.rotation = originalRotation; resetPositionInDeath = false; } pause.DeactivateDeathCanvas(); fpsPlayerRef.RemoveInvulnerability(); fpsPlayerRef.ActivateADShield(5.0f); HZIncentivizedAd.Fetch(); } #endif }
void GameOver() { Main.Instance.totalGames++; scoreText.text = "" + PlayerControl.gameScore; if (PlayerControl.gameScore > Main.Instance.bestScore) { Main.Instance.bestScore = PlayerControl.gameScore; PlayerPrefs.SetInt(Constants.BEST_SCORE, Main.Instance.bestScore); Main.Instance.PostScoreToLeaderBoard(Main.Instance.bestScore); } bestScore.text = "BEST " + Main.Instance.bestScore; starCntText.text = "" + Main.Instance.starsCnt; PlayerPrefs.SetInt(Constants.GAME_COUNT, Main.Instance.totalGames); PlayerPrefs.SetInt(Constants.STAR_TOTAL, Main.Instance.starsCnt); PlayerPrefs.Flush(); //Set up rewards button if (Main.Instance.totalGames % 5 == 0) { freeGiftBtn.interactable = true; freeGiftBtn.gameObject.SetActive(true); } else if (HZIncentivizedAd.IsAvailable()) { videoBtn.interactable = true; videoBtn.gameObject.SetActive(true); } else if (!HZIncentivizedAd.IsAvailable()) { videoBtn.gameObject.SetActive(false); } CheckUnlockChar(); Invoke("ShowGO", 0.7f); }
/// <summary> /// returns true if this instance is reward video available; otherwise, <c>false</c>. /// </summary> /// public bool IsRewardVideoAvailable() { Toaster.ShowDebugToast("IsRewardVideoAvailable: " + HZIncentivizedAd.IsAvailable()); return(HZIncentivizedAd.IsAvailable()); }
public bool IsRewardVideoAvailable(string tag) { Toaster.ShowDebugToast("IsRewardVideoAvailable for tag; " + tag + " = " + HZIncentivizedAd.IsAvailable(tag)); return(HZIncentivizedAd.IsAvailable(tag)); }
/// <summary> /// Check if Heyzap rewarded video is available /// </summary> /// <returns>true if a rewarded video is available</returns> public bool IsRewardVideoAvailable() { return(HZIncentivizedAd.IsAvailable()); }