コード例 #1
0
ファイル: HeyzapClientImpl.cs プロジェクト: akil03/bx
        //------------------------------------------------------------
        // Init.
        //------------------------------------------------------------

        public void Init(AdSettings settings)
        {
            #if EM_HEYZAP
            if (isInitialized)
            {
                Debug.Log("Heyzap client is already initialized. Ignoring this call.");
                return;
            }

            // Store a reference to the global settings.
            globalAdSettings = settings;

            // Start Heyzap with no automatic fetching since we'll handle ad loading.
            HeyzapAds.Start(globalAdSettings.HeyzapPublisherId, HeyzapAds.FLAG_DISABLE_AUTOMATIC_FETCHING);

            // Add callback handlers
            HZBannerAd.SetDisplayListener(BannerAdCallback);
            HZInterstitialAd.SetDisplayListener(InterstitialAdCallback);
            HZIncentivizedAd.SetDisplayListener(RewardedAdCallback);

            isInitialized = true;
            Debug.Log("Heyzap client has been initialized.");
            #else
            Debug.LogError(NO_SDK_MESSAGE);
            #endif
        }
コード例 #2
0
ファイル: ThemesPanel.cs プロジェクト: taocong810/WordSearch
    // Use this for initialization
    void Start()
    {
        selectedColor = new Color(1, 205.0f / 255, 106.0f / 255, 1);
        unselectColor = new Color(1, 1, 1, 0);
        themeBtnBg.GetComponent <Outline>().effectColor   = selectedColor;
        achvBtnBg.GetComponent <Outline>().effectColor    = unselectColor;
        diamongBtnBg.GetComponent <Outline>().effectColor = unselectColor;

        themesTab.gameObject.SetActive(true);
        achivementTab.gameObject.SetActive(false);
        diamondTab.gameObject.SetActive(false);
        settingPanel.gameObject.SetActive(false);
        rewardPanel.gameObject.SetActive(false);

        if (GameData.gameType == EGameType.ThemeSelection)
        {
            mainCatPanel.gameObject.SetActive(false);
            subCatPanel.gameObject.SetActive(true);
        }
        else
        {
            if (!mainCatPanel.gameObject.activeSelf)
            {
                mainCatPanel.gameObject.SetActive(true);
                subCatPanel.gameObject.SetActive(false);
            }
        }
        HZIncentivizedAd.SetDisplayListener(videoAdListener);
        HZIncentivizedAd.Fetch();
    }
コード例 #3
0
    public override void Show(AdsElement type)
    {
        if (!AdsController.NoAds)
        {
            switch (type.type)
            {
            case AdsType.Interstitial:
                HZShowOptions showOptions = new HZShowOptions();
                showOptions.Tag = type.name;
                HZInterstitialAd.ShowWithOptions(showOptions);
                break;

            case AdsType.Video:
                HZShowOptions showOptionsVideo = new HZShowOptions();
                showOptionsVideo.Tag = type.name;
                HZVideoAd.ShowWithOptions(showOptionsVideo);
                break;

            case AdsType.RewardedVideo:
                HZIncentivizedShowOptions showOptionsReward = new HZIncentivizedShowOptions();
                showOptionsReward.Tag = type.name;
                HZIncentivizedAd.ShowWithOptions(showOptionsReward);
                break;
            }
        }
    }
コード例 #4
0
ファイル: AdsManager.cs プロジェクト: zmer007/noodleadstest
 public void ShowRewarded()
 {
     if (HZIncentivizedAd.IsAvailable())
     {
         HZIncentivizedAd.Show();
     }
 }
コード例 #5
0
 public void showRewardVideo()
 {
     if (HZIncentivizedAd.IsAvailable())
     {
         HZIncentivizedAd.Show();
     }
 }
コード例 #6
0
        protected override void InternalInit()
        {
            #if EM_HEYZAP
            // Store a reference to the global settings.
            mGlobalAdSettings = EM_Settings.Advertising.Heyzap;

            // Set GPDR consent (if any) *before* starting the SDK
            // https://developers.heyzap.com/docs/unity_sdk_setup_and_requirements
            var consent = GetApplicableDataPrivacyConsent();
            ApplyDataPrivacyConsent(consent);

            // Start Heyzap with no automatic fetching since we'll handle ad loading.
            HeyzapAds.Start(mGlobalAdSettings.PublisherId, HeyzapAds.FLAG_DISABLE_AUTOMATIC_FETCHING);

            // Add callback handlers
            HZBannerAd.SetDisplayListener(BannerAdCallback);
            HZInterstitialAd.SetDisplayListener(InterstitialAdCallback);
            HZIncentivizedAd.SetDisplayListener(RewardedAdCallback);
            HeyzapAds.SetNetworkCallbackListener(NetworkCallbackListener);

            mIsInitialized = true;
            Debug.Log("Heyzap client has been initialized.");
            #else
            Debug.LogError(NO_SDK_MESSAGE);
            #endif
        }
コード例 #7
0
 public void CacheRewardedVideo(string tag)
 {
                 #if API_ADS_HEYZAP
     //Debug.Log("CacheRewardedVideo: " + tag);
     HZIncentivizedAd.Fetch(tag);
                 #endif
 }
コード例 #8
0
        void FetchAds()
        {
            foreach (string tag in adsSettings.rewardAdTags)
            {
                HZIncentivizedAd.Fetch(tag);
                Toaster.ShowDebugToast("Fetching 'reward' ad for tag; " + tag);
            }

            //Dont fetch interstitials if NoAds is baught
            if (adsRemoved)
            {
                Toaster.ShowDebugToast("Not fetching other ads because 'Remove_ads' is bought.");
                return;
            }

            HZInterstitialAd.ChartboostFetchForLocation("Default");

            foreach (string tag in adsSettings.staticAdTags)
            {
                HZInterstitialAd.Fetch(tag);
                Toaster.ShowDebugToast("Fetching 'static' ad for tag; " + tag);
            }
            foreach (string tag in adsSettings.videoAdTags)
            {
                HZVideoAd.Fetch(tag);
                Toaster.ShowDebugToast("Fetching 'video' ad for tag; " + tag);
            }
        }
コード例 #9
0
    // Use this for initialization
    void Start()
    {
        StoreEvents.OnMarketPurchase       += onMarketPurchase;
        StoreEvents.OnUnexpectedStoreError += onUnexpectedStoreError;

        HZIncentivizedAd.AdDisplayListener listener = delegate(string adState, string adTag){
            if (adState.Equals("incentivized_result_complete"))
            {
                // The user has watched the entire video and should be given a reward.
                GameData.Instance.multiRemainingGameCount += 5;
                GameData.Instance.rewardedGameCount       += 5;
                GameData.Instance.Save();
            }
            if (adState.Equals("incentivized_result_incomplete"))
            {
                // The user did not watch the entire video and should not be given a   reward.
            }
        };

        HZIncentivizedAd.SetDisplayListener(listener);

        HZIncentivizedAd.Fetch();

//		if (GameData.Instance.multiRemainingGameCount <= 0) {
//			active = true;
////			checkDailyLimitExceed ();
//		} else {
//			active = false;
//		}

//		if (StoreInventory.GetItemBalance (NumberGameAssets.NO_ADS_ITEM_ID) > 0) {
//			noAds.enabled = false;
//			noAds.GetComponentInChildren<Text>().text = "All ads removed";
//		}
    }
コード例 #10
0
    static void Initialize()
    {
        string HeyzapID;

        switch (StudioSettings.Instance.studio)
        {
        case StudioSettings.Studio.TopGame:
            HeyzapID = "cde2146866f96c9ad90736c1af512e13";
            break;

        case StudioSettings.Studio.FreeGame:
            HeyzapID = "ef2a0c12b6d378ddce5063ca08a660b9";
            break;

        case StudioSettings.Studio.CrystalBuffalo:
            HeyzapID = "70a2f87d4c05ba041dada7f272651dba";
            break;

        case StudioSettings.Studio.SurvivalGame:
            HeyzapID = "9dff8b4f221dbad7cbbeeb52b2fc6125";
            break;

        default:
            HeyzapID = "cde2146866f96c9ad90736c1af512e13";
            break;
        }

        // TO DO: Something needs to be done to initialize Heyzap!
        // It is no longer in the launch controller.
        HeyzapAds.Start(HeyzapID, HeyzapAds.FLAG_NO_OPTIONS);
        HZVideoAd.Fetch();
        HZIncentivizedAd.Fetch();
    }
コード例 #11
0
    public void IsAvailableButton()
    {
        string tag       = this.adTag();
        bool   available = false;

        switch (this.SelectedAdType)
        {
        case AdType.Interstitial:
            available = HZInterstitialAd.IsAvailable(tag);
            break;

        case AdType.Video:
            available = HZVideoAd.IsAvailable(tag);
            break;

        case AdType.Incentivized:
            available = HZIncentivizedAd.IsAvailable(tag);
            break;

        case AdType.Banner:
            // Not applicable
            break;

        case AdType.Offerwall:
            available = HZOfferWallAd.IsAvailable(tag);
            break;
        }

        string availabilityMessage = available ? "available" : "not available";

        this.console.Append(this.SelectedAdType.ToString() + " with tag: " + tag + " is " + availabilityMessage);
    }
コード例 #12
0
    public void showHZRewardedAdVideos()
    {
//		if (GameData.Instance.multiRemainingGameCount <= 0) {

//			if (GameData.Instance.rewardedGameCount >= GameData.Instance.dailyLimit * 5) {

//				requestUTCTimeFromServer ();

//				GameData.Instance.rewardedGameCount = 0;
//				GameData.Instance.Save ();
//
//				string message = "Unfortunately your credit limit exeeded. 4 hours later you can gain credit watching rewarded videos. You can gain more credits by purchasing game packages from the shopping list";
//				dialogueManager = DialogueManager.Instance ();
//				dialogueManager.showDialog ("Info",message, 0);

//				return;
//			}

        if (HZIncentivizedAd.IsAvailable())
        {
            HZIncentivizedAd.Show();
        }

        HZIncentivizedAd.Fetch();

//		} else {

//			string message = "Please try again when your credit runs out. In case of no credits left you can gain again";
//			dialogueManager = DialogueManager.Instance ();
//			dialogueManager.showDialog ("Info",message, 0);
//		}
    }
コード例 #13
0
ファイル: HeyzapClientImpl.cs プロジェクト: akil03/bx
 public bool IsRewardedAdReady(AdLocation location)
 {
     #if EM_HEYZAP
     return(HZIncentivizedAd.IsAvailable());
     #else
     return(false);
     #endif
 }
コード例 #14
0
ファイル: HeyzapClientImpl.cs プロジェクト: akil03/bx
        //------------------------------------------------------------
        // Rewarded Ads.
        //------------------------------------------------------------

        public void LoadRewardedAd(AdLocation location)
        {
            #if EM_HEYZAP
            HZIncentivizedAd.Fetch();
            #else
            Debug.LogError(NO_SDK_MESSAGE);
            #endif
        }
コード例 #15
0
 public static void initReceiver()
 {
     if (_instance == null) {
       GameObject receiverObject = new GameObject("HZIncentivizedAd");
       DontDestroyOnLoad(receiverObject);
       _instance = receiverObject.AddComponent<HZIncentivizedAd>();
     }
 }
コード例 #16
0
 /// <summary>
 /// Show Heyzap rewarded video
 /// </summary>
 /// <param name="CompleteMethod">callback called when user closes the rewarded video -> if true, video was not skipped</param>
 public void ShowRewardVideo(UnityAction <bool, string> CompleteMethod)
 {
     if (HZIncentivizedAd.IsAvailable())
     {
         OnCompleteMethodWithAdvertiser = CompleteMethod;
         HZIncentivizedAd.Show();
     }
 }
コード例 #17
0
 /// <summary>
 /// Show Heyzap rewarded video
 /// </summary>
 /// <param name="CompleteMethod">callback called when user closes the rewarded video -> if true, video was not skipped</param>
 public void ShowRewardVideo(UnityAction <bool> CompleteMethod)
 {
     if (HZIncentivizedAd.IsAvailable())
     {
         OnCompleteMethod = CompleteMethod;
         HZIncentivizedAd.Show();
     }
 }
コード例 #18
0
 public void RewardVideo()
 {
     Main.Instance.PlayButtonSound();
     if (HZIncentivizedAd.IsAvailable())
     {
         HZIncentivizedAd.Show();
     }
 }
コード例 #19
0
 protected override void CreateEventListeners()
 {
                 #if API_ADS_HEYZAP
     HZBannerAd.SetDisplayListener(OnBannerStateUpdate);
     HZInterstitialAd.SetDisplayListener(OnInterstitialStateUpdate);
     HZVideoAd.SetDisplayListener(OnInterstitialStateUpdate);
     HZIncentivizedAd.SetDisplayListener(OnIncentivizedStateUpdate);
                 #endif
 }
コード例 #20
0
    public void showVideoAd()
    {
        if (HZIncentivizedAd.isAvailable())
        {
            HZIncentivizedAd.show();

            HZIncentivizedAd.setDisplayListener(listener);
        }
    }
コード例 #21
0
 protected override void RemoveEventListeners()
 {
                 #if API_ADS_HEYZAP
     HZBannerAd.SetDisplayListener(null);
     HZInterstitialAd.SetDisplayListener(null);
     HZVideoAd.SetDisplayListener(null);
     HZIncentivizedAd.SetDisplayListener(null);
                 #endif
 }
コード例 #22
0
//	void queryInventorySucceededEvent( List<GooglePurchase> purchases, List<GoogleSkuInfo> skus )
//	{
//		Debug.Log( string.Format( "queryInventorySucceededEvent. total purchases: {0}, total skus: {1}", purchases.Count, skus.Count ) );
//		Prime31.Utils.logObject( purchases );
//		Prime31.Utils.logObject( skus );
//		for(int i = 0; i < purchases.Count; i++)
//		{
//			Debug.Log("Order id = " + purchases[i].productId +"   State = "+ purchases[i].purchaseState);
//			if(purchases[i].purchaseState == GooglePurchase.GooglePurchaseState.Purchased)
//			{
//				//Can Restore purchse
//				Debug.Log("Can Restore purchse");
//				canRestored = true;
//			}
//		}
//
//	}
//
//
//	void queryInventoryFailedEvent( string error )
//	{
//		Debug.Log( "queryInventoryFailedEvent: " + error );
//	}
//
//	void purchaseSucceededEvent( GooglePurchase purchase )
//	{
//		Debug.Log( "purchaseSucceededEvent: " + purchase );
//		if(purchase.productId == Constants.PRODUCT_ID)
//		{
//			Debug.Log("No ads purchased");
//			HZBannerAd.hide();
//			Main.Instance.isNoAdsPurchased = true;
//			PlayerPrefs.SetBool(Constants.KEY_NOADS, Main.Instance.isNoAdsPurchased);
//			PlayerPrefs.Flush();
//
//
//			if(isRestoring)
//			{
//				#if UNITY_ANDROID
//				EtceteraAndroid.showAlert("Purchase Restored", "Ads removed", "Ok");
//				#elif UNITY_IPHONE
//				CreateAlertForRestore("Purchase Restored","Ads removed", "Ok");
//				#endif
//
//			}
//
//			if(Main.Instance.isNoAdsPurchased)
//			{
//				if(noAddButtonHome != null)
//				{
//					noAddButtonHome.interactable = false;
//				}
//			}
//
//			if(Main.Instance.isNoAdsPurchased)
//			{
//				if(noAddButtonGameOver != null)
//				{
//					noAddButtonGameOver.interactable = false;
//				}
//			}
//		}
//
//
//	}
        #endif
    #endregion



    #region Reward Video
    public void ShowRewardVideo()
    {
        if (HZIncentivizedAd.isAvailable())
        {
            GameData.isFreeGift = true;
            Main.Instance.MuteSounds();
            HZIncentivizedAd.show();
        }
    }
コード例 #23
0
 public static void initReceiver()
 {
     if (_instance == null)
     {
         GameObject receiverObject = new GameObject("HZIncentivizedAd");
         DontDestroyOnLoad(receiverObject);
         _instance = receiverObject.AddComponent <HZIncentivizedAd>();
     }
 }
コード例 #24
0
ファイル: Maze56.cs プロジェクト: aleknikolov11/Maze-Game
 public void GetShards()
 {
     if (HZIncentivizedAd.IsAvailable())
     {
         HZIncentivizedAd.Show();
         PlayerPrefs.SetInt("currentShards", PlayerPrefs.GetInt("currentShards") + 5);
         MoreShards.SetActive(false);
         MapPanel.SetActive(true);
     }
 }
コード例 #25
0
        public void ShowRewardedVideo(string tag)
        {
                        #if API_ADS_HEYZAP
            HZIncentivizedShowOptions options = new HZIncentivizedShowOptions();
            options.Tag = tag;

            HZIncentivizedAd.ShowWithOptions(options);
            HZIncentivizedAd.Fetch(tag);
                        #endif
        }
コード例 #26
0
ファイル: AdManager.cs プロジェクト: bigstupidx/CrashBlock
 // Use this for initialization
 void Start()
 {
     HeyzapAds.Start("f62dff4e4bbf49a67e29252338b6d0d7", HeyzapAds.FLAG_NO_OPTIONS);
     HZIncentivizedAd.Fetch();
     fpsPlayerRef.GetComponent <FPSPlayer>();
     fpsPlayerTransform = fpsPlayerRef.GetComponent <Transform>();
     originalPosition   = fpsPlayerTransform.position;
     originalRotation   = fpsPlayerTransform.rotation;
     weapons.GetComponent <PlayerWeapons> ();
 }
コード例 #27
0
 private static bool PlayHeyzapIncentivizedAd()
 {
     if (HZIncentivizedAd.IsAvailable())
     {
         HZIncentivizedAd.Show();
         HZIncentivizedAd.Fetch();
         return(true);
     }
     return(false);
 }
コード例 #28
0
ファイル: Maze9.cs プロジェクト: aleknikolov11/Maze-Game
    void Start()
    {
        mapButtonClicked = false;
        bestTimeVariable = "bestTimeLevel9";
        currentShardsForLevelVariable = "currentShardsForLevel9";
        currentMapVariable            = "mapLevel9";
        currentLevel = 9;
        HeyzapAds.Start("3a045a04722e168baefdd3eeff198305", HeyzapAds.FLAG_NO_OPTIONS);
        HZVideoAd.Fetch();
        HZIncentivizedAd.Fetch();
        map = new int[6, 6] {
            { 4, 2, 2, 3, 2, 4 }, { 2, 2, 3, 2, 1, 2 }, { 3, 2, 1, 4, 2, 2 }, { 2, 1, 2, 3, 2, 3 }, { 4, 3, 2, 3, 2, 3 }, { 2, 2, 2, 4, 2, 2 }
        };
        rotations = new int[6, 6] {
            { 1, 1, 0, 0, 1, 2 }, { 0, 2, 1, 0, 3, 2 }, { 1, 0, 2, 0, 0, 1 }, { 3, 2, 3, 0, 2, 1 }, { 2, 1, 0, 0, 1, 1 }, { 3, 2, 3, 3, 3, 2 }
        };
        MazeGenerator.instance.mazeGenerator(map, rotations, 6);
        Ball.transform.position   = start;
        Ball.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f);
        Ball.SetActive(true);
        Instantiate(FinishParticleSystem, finish, Quaternion.identity);
        if (!PlayerPrefs.HasKey(currentShardsForLevelVariable))
        {
            PlayerPrefs.SetInt(currentShardsForLevelVariable, 0);
        }

        currentSpawnsLeft = 3 - PlayerPrefs.GetInt(currentShardsForLevelVariable);
        while (currentSpawnsLeft > 0)
        {
            int   randX  = Random.Range(0, 6);
            int   randZ  = Random.Range(0, 6);
            float Shardx = (float)randX + 0.05f;
            float Shardy = (float)randZ + 0.05f;
            if (Shardx != start.x && Shardx != finish.x && Shardy != start.z && Shardy != finish.z)
            {
                Instantiate(Shard, new Vector3((float)randX, 0.15f, (float)randZ), Quaternion.identity);
                currentSpawnsLeft--;
            }
        }
        if (!PlayerPrefs.HasKey(bestTimeVariable))
        {
            bestTimeScore.text = "00:00";
        }
        else
        {
            bestTimeScore.text = ((int)(PlayerPrefs.GetFloat(bestTimeVariable) / 60f)).ToString("00") + ":" + ((int)(PlayerPrefs.GetFloat(bestTimeVariable) % 60f)).ToString("00");
        }
        currentTime           = 0f;
        shardsText.text       = PlayerPrefs.GetInt("currentShards").ToString();
        currentTimeText.text  = "";
        currentTimeScore.text = "";
        bestTimeScore.text    = "";
        timeString            = "";
        gameOver = false;
    }
コード例 #29
0
 public void ContinueYES()
 {
     isReviveBreaked = true;
     CancelInvoke("CntDown");
     StopCoroutine(Timer());
     Main.Instance.PlayButtonClickSound();
     if (HZIncentivizedAd.isAvailable())
     {
         HZIncentivizedAd.Show();
     }
 }
コード例 #30
0
    public void Die()
    {
        if (!isRevived && HZIncentivizedAd.isAvailable())
        {
//			Debug.Log("Set revive");
            SetState(BirdState.WaitForRevive);
        }
        else
        {
            SetState(BirdState.Died);
        }
    }
コード例 #31
0
        //------------------------------------------------------------
        // Rewarded Ads.
        //------------------------------------------------------------

        protected override void InternalLoadRewardedAd(AdPlacement placement)
        {
            #if EM_HEYZAP
            if (placement == AdPlacement.Default)
            {
                HZIncentivizedAd.Fetch();
            }
            else
            {
                HZIncentivizedAd.Fetch(ToHeyzapAdTag(placement));
            }
            #endif
        }