Example #1
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();
        }
    }
Example #2
0
    public void showVideoAd()
    {
        if (HZIncentivizedAd.isAvailable())
        {
            HZIncentivizedAd.show();

            HZIncentivizedAd.setDisplayListener(listener);
        }
    }