using UnityEngine; using UnityEngine.UI; using UnityEngine.Purchasing; using System.Collections; using System.Collections.Generic; public class BuyCoinItem : ItemRenderer { public Text numTxt; public Text priceTxt; public override object data { get { return base.data; } set { base.data = value; ShopData shopData = value as ShopData; if (shopData != null) { numTxt.text = "+ " + shopData.value; priceTxt.text = shopData.price; } } } public void OnClick() { ShopData shopData = data as ShopData; if(shopData != null) { PaymentManager.GetIntance ().OnPurchaseClicked (shopData.name); } } }