Example #1
0
 public PurchaseCompletedEventArgs(Product product, PurchaseCheckingState checkingState,
                                   SpecialOffers.Replacement replacement, string soPayload = null, string originReceipt = null)
 {
     this.product       = product;
     this.checkingState = checkingState;
     this.replacement   = replacement;
     this.soPayload     = soPayload;
     this.originReceipt = originReceipt;
 }
Example #2
0
 public void Buy(SpecialOffers.Replacement replacement)
 {
     if (_store == null)
     {
         throw new UnityException("Not properly inited");
     }
     Check();
     LogUtils.Log("Buy special offer " + replacement.sku);
     if (!replacement.product.availableToPurchase)
     {
         LogUtils.Log("Product " + replacement.product.definition.id + " is not available to purchase");
         return;
     }
     _store.InitiatePurchase(replacement.product, null);
 }
Example #3
0
        public void UpdateView()
        {
            if (!info)
            {
                return;
            }
            _coins.text  = info.coins.ToString();
            _price.text  = "$" + info.price.ToString();
            _icon.sprite = info.icon;
            _so.enabled  = false;

            replacement = Gow.GetReplacement(info.name);
            if (replacement != null)
            {
                Debug.Log("Best price");
                _so.enabled = true;
                _price.text = "$" + replacement.price.ToString("#.##");
            }
        }
Example #4
0
 /// <summary>
 /// Initialize start of purchasing special offer.
 /// </summary>
 /// <param name="replacement">Special offer to buy</param>
 public static void Buy(SpecialOffers.Replacement replacement)
 {
     Controller.instance.Buy(replacement);
 }
Example #5
0
 public ReplacementEventArgs(SpecialOffers.Replacement replacement)
 {
     this.replacement = replacement;
 }