void SetItemDetailDisplay(UnityUIStoreItem storeItem) { string statusText = ""; foreach (StoreItemDetail detail in storeItem.storeItem.itemDetail) { statusText += detail.propertyName + " : " + detail.propertyValue + "\n"; } itemDetailsDisplay.text = statusText; }
public string Setup() { item = GetComponent <UnityUIStoreItem>(); string formated = item.storeItem.itemName; foreach (StoreItemDetail detail in item.storeItem.itemDetail) { formated = string.Format("{0}\n{1}: {2}", formated, detail.propertyName, detail.propertyValue.ToString()); } return(formated); }
public void DisplayItemPurchasePanel(UnityUIStoreItem item) { itemInfo = item; itemNameDisplay.text = item.storeItem.itemName; premiumCurrencyCost = item.storeItem.premiumCurrencyValue; standardCurrencyCost = item.storeItem.standardCurrencyValue; itemQuantityAmount.text = "1"; SetItemDetailDisplay(item); itemTexture.texture = item.gameObject.GetComponentInChildren <RawImage>().texture; ChangePurchaseButtonDisplay(item.storeItem.premiumCurrencyValue, item.storeItem.standardCurrencyValue); }
public override void LoadStoreWithPaging(List <StoreItem> listItems, int pageNum) { if (isLoadingPage == false) { isLoadingPage = true; filteredList = listItems; if (currentPageItems.Count > 0) { ClearCurrentGrid(); } currentPageItems.Clear(); int PageMax = GetPageMax(listItems.Count, pageNum); for (int i = pageNum * maxGridAmount; i < (pageNum * maxGridAmount + PageMax); i++) { GameObject newItem = (GameObject)GameObject.Instantiate(itemButtonPrefab); newItem.transform.SetParent(transform); newItem.transform.localPosition = Vector3.zero; newItem.transform.localScale = Vector3.one; currentPageItems.Add(newItem); UnityUIStoreItem itemInfo = newItem.GetComponent <UnityUIStoreItem>(); itemInfo.Init(listItems[i], this); Button storeButton = newItem.GetComponent <Button>(); storeButton.onClick.AddListener(itemInfo.OnStoreItemClicked); } SetPageButtons(GetPageAmount(listItems.Count)); isLoadingPage = false; } }