예제 #1
0
        public IAPDetail SetIAPDetail(IAPDetail iAPDetail)
        {
            if (iAPDetail.productType.Equals(ProductType.NonConsumable))
            {
                iAPDetail.isBought = true;
            }
            else if (iAPDetail.productType.Equals(ProductType.Consumable))
            {
                if (!iAPDetail.isBought)
                {
                    iAPDetail.isBought = ++iAPDetail.presentCount > iAPDetail.maxCount;
                }
            }

            if (Currency.CurrencyController.instance)
            {
                Currency.CurrencyController.instance.SetCurrency(iAPDetail.currencyReward.eCurrency, iAPDetail.currencyReward.unit);
            }

            return(iAPDetail);
        }
예제 #2
0
        public IAPDetail SetIAPDetail(string id)
        {
            IAPDetail _iAPDetail = iAPDetails.Where(item => item.id.Equals(id)).First();

            if (_iAPDetail.productType.Equals(ProductType.NonConsumable))
            {
                _iAPDetail.isBought = true;
            }
            else if (_iAPDetail.productType.Equals(ProductType.Consumable))
            {
                if (!_iAPDetail.isBought)
                {
                    _iAPDetail.isBought = ++_iAPDetail.presentCount >= _iAPDetail.maxCount;
                }
            }

            if (Currency.CurrencyController.instance)
            {
                Currency.CurrencyController.instance.SetCurrency(_iAPDetail.currencyReward.eCurrency, _iAPDetail.currencyReward.unit);
            }

            return(_iAPDetail);
        }
예제 #3
0
파일: IAPProcess.cs 프로젝트: insepter/DMN
        static void PurchaseComplete(PurchaseEventArgs purchaseEvent)
        {
            IAPDetail _iapDetail = _callIAPData.Invoke().SetIAPDetail(purchaseEvent.purchasedProduct.definition.id);

            callBackButtonPurchase?.Invoke(_iapDetail);
        }
예제 #4
0
 void PurchaseComple(IAPDetail iAPDetail)
 {
     Debug.Log($"Complete: {id} -- productType: {productType} -- Active: {iAPDetail.isBought}");
     SetCountGetReward($"{iAPDetail.presentCount}/{iAPDetail.maxCount}");
     purchaseBtn.interactable = !iAPDetail.isBought;
 }