예제 #1
0
    void SetItemDetailDisplay(UnityUIStoreItem storeItem)
    {
        string statusText = "";

        foreach (StoreItemDetail detail in storeItem.storeItem.itemDetail)
        {
            statusText += detail.propertyName + " : " + detail.propertyValue + "\n";
        }

        itemDetailsDisplay.text = statusText;
    }
예제 #2
0
    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);
    }
예제 #3
0
    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);
    }
예제 #4
0
    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;
        }
    }