예제 #1
0
 //Step 4 modify purchasing
 public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
 {
     if (String.Equals(args.purchasedProduct.definition.id, removeAds, StringComparison.Ordinal))
     {
         Debug.Log("remove ads for this user");
         if (PlayerPrefs.HasKey("ads") == false)
         {
             PlayerPrefs.SetInt("ads", 0);
         }
         UnityAds.RemoveBanner();
         GameObject.Find("txt_rm_ads").GetComponent <TMPro.TextMeshProUGUI>().text = "Thank You";
     }
     else
     {
         Debug.Log("Purchase Failed");
     }
     return(PurchaseProcessingResult.Complete);
 }