Skip to content

Commit

Permalink
Enable item any way
Browse files Browse the repository at this point in the history
  • Loading branch information
manjav committed May 18, 2022
1 parent 99ea87b commit 5643d69
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,21 @@ public ShopItem Init(Product product, Action<SKUDetails, string> onSelect, Actio
this.onDelete = onDelete;
iconImage.sprite = product.icon;
button = GetComponent<Button>();
button.interactable = false;
dynamicPriceInput.gameObject.SetActive(product.id == "dynamic_price");
return this;
}

public void CommitData(SKUDetails skuDetails, PurchaseInfo purchaseInfo)
{
button.interactable = false;
this.purchaseInfo = purchaseInfo;
this.skuDetails = skuDetails;
titleText.text = skuDetails.title;
priceText.text = skuDetails.price.Replace(",", "");
descriptionText.text = skuDetails.description;

button.interactable = purchaseInfo == null;
if (skuDetails.isAvailable)
if (skuDetails.sku == "premium")
{
skuDetails.isAvailable = purchaseInfo != null && purchaseInfo.productId == "premium";
deleteButton.gameObject.SetActive(purchaseInfo != null);
}
deleteButton.gameObject.SetActive(skuDetails.isAvailable);
}

public void OnClick()
Expand Down

0 comments on commit 5643d69

Please sign in to comment.