Exemplo n.º 1
0
    // refresh the package item
    public void UpdatePackageItem(ItemSlotType _type)
    {
        mCurrPackageType = _type;

        // clear the former selected item
        if (mCurrSelectedIconData != null)
        {
            mCurrSelectedIconData.checkButton.isChecked = false;
        }
        mCurrSelectedIconData = null;

        ItemTipsName.transform.localScale  = Vector3.one;
        ItemTipsMoney.transform.localScale = Vector3.one;
        ItemTipsDesc.transform.localScale  = Vector3.one;

        // foreach(AttributeIcon icon in ItemAttributeIcon){
        //  icon.transform.localScale = Vector3.one;
        // }

        // hide the operation button
        ShowOpBtn(null);

        List <ItemSlotData> tDataList = ItemDataManager.Instance.GetItemDataList(_type);

        for (int i = 0; i < mCurrIconItemList.Count; i++)
        {
            IconData t_iconData = mCurrIconItemList[i];

            t_iconData.checkButton.isChecked = false;

            bool t_setIcon = false;

            // add Dictionary.Values to List for iterating
            foreach (ItemSlotData data in tDataList)
            {
                if (data.LocationID == i)
                {
                    t_setIcon           = true;
                    t_iconData.itemData = data;
                    HelpUtil.SetItemIcon(t_iconData.checkButton.transform, t_iconData.itemData, !ShopSellItemPackage);
                    break;
                }
            }

            if (!t_setIcon)
            {
                t_iconData.itemData            = new ItemSlotData();
                t_iconData.itemData.LocationID = i;
                t_iconData.itemData.SlotType   = _type;
                t_iconData.itemData.SlotState  = ItemSlotState.LOCK;
                HelpUtil.SetItemIcon(t_iconData.checkButton.transform, null, !ShopSellItemPackage);
            }
        }

        mCurrSelPageIndicatorIdx = 0;

        // SetPackageHighLight(HighLightRule.HIGHLIGHT_NONE);
    }
Exemplo n.º 2
0
 // Update is called once per frame
 public void SetItemIcon(ItemSlotData data, bool lockedOrEmpty)
 {
     mItemData = data;
     HelpUtil.SetItemIcon(transform, data, lockedOrEmpty);
 }