Exemplo n.º 1
0
    /// <summary>
    /// 点击购买按钮
    /// </summary>
    void PurchaseShopItem(GameObject go)
    {
        ShopItemUI ui = go.GetComponentInParent <ShopItemUI>();

        if (ui == null)
        {
            return;
        }
        int lv = ui.GetLevel();

        if (lv >= 5)
        {
            GameController.Instance.ShowTips("This item is already level max.");
            return;
        }
        int price = ui.GetPrice();

        if (GameController.Instance.Money < ui.GetPrice())
        {
            GameController.Instance.ShowTips("You cannot afford this item. (not enough money)");
            return;
        }
        mAudio.Play();
        GameController.Instance.FixMoney(-price);
        ui.UpdateInfo(lv + 1);
        RefreshPriceColor();
        GameController.Instance.UpdateItem(ui.mItem, lv + 1);
    }
Exemplo n.º 2
0
    public void InitItems(List <UpgradeCategory> upgradesCategories)
    {
        for (int i = 0; i < upgradesCategories.Count; i++)
        {
            GameObject    container          = Instantiate(categroryContainerPrefab, _transform, false) as GameObject;
            Transform     containerTransform = container.GetComponent <Transform>();
            RectTransform containerRectTrans = container.GetComponent <RectTransform>();
            containerRectTrans.anchorMin = Vector2.zero;
            containerRectTrans.anchorMax = new Vector2(1, 1);

            for (int j = 0; j < upgradesCategories[i].upgrades.Count; j++)
            {
                BaseUpgrade upgradePrefab = upgradesCategories[i].upgrades[j];
                GameObject  itemGO        = Instantiate(shopItemPrefab, containerTransform, false) as GameObject;
                ShopItemUI  item          = itemGO.GetComponent <ShopItemUI>();
                Instantiate(upgradePrefab, itemGO.transform, false);
                item.Init(upgradePrefab, upgradeShop);

                items.Add(item);
            }

            container.SetActive(false);
            categoriesContainers.Add(upgradesCategories[i], container);
        }
    }
Exemplo n.º 3
0
    void ShowStoreItem()
    {
        HideItems();
        List <CityShopRef> rankList = CurShowItems;

        for (int i = 0, max = rankList.Count; i < max; i++)
        {
            ShopItemUI item = null;
            if (!allItemList.TryGetValue(i, out item))
            {
                GameObject go = Instantiate(exResources.GetResource(ResourceType.GUI, "GuildActivity/CityShopItem")) as GameObject;
                if (go != null)
                {
                    item = go.GetComponent <ShopItemUI>();
                    if (panelStore != null)
                    {
                        go.transform.parent = panelStore.transform;
                    }
                    go.transform.localScale = Vector3.one;
                }
                go             = null;
                allItemList[i] = item;
            }
            item = allItemList[i];
            if (item != null)
            {
                item.gameObject.SetActive(true);
                item.transform.localPosition = new Vector3(positionInfo.x + positionInfo.z * (i % 3), positionInfo.y + positionInfo.w * (i / 3), 0f);
                item.FillInfo(rankList[i]);
            }
        }
    }
Exemplo n.º 4
0
 /// <summary>
 /// 选中一个技能
 /// </summary>
 /// <param name="_itemUI"></param>
 void OnSelectSkillUI(ShopItemUI _itemUI)
 {
     //selectSkillUI = _itemUI;
     //if (OnSelectItemEvent != null)
     //	{
     //	OnSelectItemEvent(selectSkillUI);
     //}
 }
Exemplo n.º 5
0
 public void SetCurrent()
 {
     SelectedObject.SetActive(true);
     if (lastSelected != null && lastSelected != this)
     {
         lastSelected.SelectedObject.SetActive(false);
     }
     lastSelected = this;
 }
Exemplo n.º 6
0
    private void AddItemToShop(ItemData item)
    {
        ItemData   _item    = item;
        GameObject testGo   = Instantiate(_shopItemUIPrefab, _contentTransform);
        ShopItemUI shopItem = testGo.GetComponent <ShopItemUI>();

        shopItem.SetItem(_item);
        shopItem.ClickEvent += SelectItem;
    }
Exemplo n.º 7
0
 public void SetCurrent()
 {
     SelectedObject.SetActive(true);
     if (lastSelected != null && lastSelected != this)
     {
         lastSelected.SelectedObject.SetActive(false);
     }
     lastSelected = this;
     Debug.LogWarning("Selected " + lastSelected.name);
 }
Exemplo n.º 8
0
 //计算商品价格
 private void CalcItemPrice(ShopItemUI item)
 {
     if (shopData.goldCount >= item.itemPrice)
     {
         item.BuyEnd();                                                                //隐藏购买UI按钮.
         shopData.goldCount -= item.itemPrice;                                         //减去已消耗的金币
         UpdateUI();                                                                   //更新UI.
         shopData.UpdateXMLDate(savePath, "GoldCount", shopData.goldCount.ToString()); //更新xml金币数量
         shopData.UpdateXMLDate(savePath, "ID" + item.itemId, "1");                    //更新xml中商品状态.
     }
 }
Exemplo n.º 9
0
    /// <summary>
    /// 刷新表现
    /// </summary>
    public void RefreshItems()
    {
        Object shopItemprefab = null;

        if (shopItemprefab == null)
        {
            shopItemprefab = exResources.GetResource(ResourceType.GUI, "Shop/ShopItem");
        }
        if (shopItemprefab == null)
        {
            GameSys.LogError("找不到预制:Shop/ShopItem");
            return;
        }
        Vector3 V3 = Vector3.zero;

        for (int i = 0; i < shopItemList.Count; i++)
        {
            if (!ShopItemContainers.ContainsKey(i))
            {
                GameObject obj          = Instantiate(shopItemprefab) as GameObject;
                Transform  parentTransf = this.gameObject.transform;
                obj.transform.parent        = parentTransf;
                obj.transform.localPosition = V3;
                obj.transform.localScale    = Vector3.one;
                if ((i + 1) % 2 == 0)
                {
                    V3 = new Vector3(0, V3.y - 140, V3.z);
                }
                else
                {
                    V3 = new Vector3(V3.x + 220, V3.y, V3.z);
                }


                ShopItemUI shopItemUI = obj.GetComponent <ShopItemUI>();
                shopItemUI.FillInfo(shopItemList[i]);
                shopItemUI.OnSelectEvent += OnSelectSkillUI;
                ShopItemContainers[i]     = shopItemUI;
                //                if (firstRun && skillList[i].SkillLv>0)
                //                {
                //                    firstRun = false;
                //                    selectSkillUI = skillUI;
                //                    UIToggle tog = obj.GetComponent<UIToggle>();
                //                    tog.value = true;
                //                    if (OnSelectItemEvent != null)
                //                    {
                //                        OnSelectItemEvent(selectSkillUI);
                //                    }
                //                }
            }
        }
    }
Exemplo n.º 10
0
    void SelectItemUI(int itemIndex)
    {
        previousSelectedTheme = newSelectedTheme;
        newSelectedTheme      = itemIndex;

        ShopItemUI prevUiItem = GetItemUI(previousSelectedTheme);
        ShopItemUI newUiItem  = GetItemUI(newSelectedTheme);

        prevUiItem.DeselectItem();
        newUiItem.SelectItem();
        GameDataManager.SetSelectedThemeIndex(newSelectedTheme);
        SetSelectedTheme();
    }
Exemplo n.º 11
0
 void initItem()
 {
     for (int i = 0; i < ItemDefine.itemCodeToBuy.Length; i++)
     {
         ItemInShop itemInShop    = ItemInShop.make(ItemDefine.itemCodeToBuy [i]);
         GameObject newShopItemUI = Instantiate(shopItemUIPrefab) as GameObject;
         newShopItemUI.transform.SetParent(shopItemHolder, false);
         newShopItemUI.transform.localScale = new Vector3(1, 1, 1);
         ShopItemUI shopItemUI = newShopItemUI.GetComponent <ShopItemUI> ();
         shopItemUI.item = itemInShop;
         shopItemUI.setUI(this);
     }
 }
Exemplo n.º 12
0
 void Start()
 {
     SetUI();
     System.Array.ForEach(shopItemData.detailShopItems, item =>
     {
         ShopItemUI _item = Instantiate(prefabShopItem, spawnPointPrefabShopItem);
         _item.SetAllUI((item.icon, item.isUse ? "Use" : item.isUnlock ? "Unlock" : item.cost.ToString(), item.refId));
         if (item.isUse)
         {
             frameItem.SetParent(_item.transform);
             frameItem.SetSizeCenter();
         }
         shopItemUIs.Add(_item);
     });
Exemplo n.º 13
0
 /// <summary>
 /// 计算商品价格
 /// </summary>
 /// <param name="item"></param>
 private void CalcItemPrice(ShopItemUI item)
 {
     if (shopData.goldCount >= item.itemPrice)
     {
         Debug.Log("购买成功");
         item.BuyEnd();                                             //隐藏购买UI按钮
         shopData.goldCount -= item.itemPrice;                      //减去已经消耗的金币
         UpdateUI();                                                //更新UI
         shopData.UpdateXMLData(savePath, "GoldCount", shopData.goldCount.ToString());
         shopData.UpdateXMLData(savePath, "ID" + item.itemId, "1"); //更新商品状态
     }
     else
     {
         Debug.Log("购买失败,金币不够");
     }
 }
Exemplo n.º 14
0
    void InitShopItems()
    {
        int i = 0;

        foreach (var itemDefine in DataManager.Instance.ShopItems[shopID].Values)
        {
            GameObject obj = ResManager.Instance.Load <GameObject>(ResManager.ResourceType.Panel, "ShopItemUI");
            obj.transform.parent        = Content;
            obj.transform.localScale    = Vector3.one;
            obj.transform.localPosition = Vector3.zero;

            ShopItemUI itemUI = obj.GetComponent <ShopItemUI>();
            itemUI.Init(this, itemDefine, i++);
            items.Add(itemUI);
        }
    }
Exemplo n.º 15
0
 private void CalcItemPrice(ShopItemUI item)
 {
     if (shopData.goldCount >= item.itemPrice)
     {
         Debug.Log("购买成功");
         item.BuyEnd();
         shopData.goldCount -= item.itemPrice;
         UpdateUI();
         shopData.UpdateXMLData(SavePath, "GoldCount", shopData.goldCount.ToString());
         shopData.UpdateXMLData(SavePath, "ID" + item.itemId, "1");
     }
     else
     {
         Debug.Log("购买失败");
     }
 }
Exemplo n.º 16
0
    public void BuyMaterials()
    {
        Transform materialsParent = UIManager.Instance.shopUI.materialsParent;

        for (int i = 0; i < materialsParent.childCount; i++)
        {
            ShopItemUI item = materialsParent.GetChild(i).GetComponent <ShopItemUI>();

            int quantity = int.Parse(item.quantityText.text);

            if (item != null && quantity > 0)
            {
                item.Buy();
            }
        }
    }
Exemplo n.º 17
0
    //Put a new item in the UI
    void UpdateGUI(IItem item, GameObject prefab, Transform parent)
    {
        //Instantiate the gui item
        GameObject go = ObjectPool.Instantiate(prefab, prefab.transform.position, prefab.transform.rotation, parent);

        //Fix the scale error
        RectTransform rect = go.GetComponent <RectTransform>();

        rect.transform.localScale = Vector3.one;

        //Load the data in the UI
        ShopItemUI itemUI = go.GetComponent <ShopItemUI>();

        itemUI.item = item;
        itemUI.UpdateUI();
    }
Exemplo n.º 18
0
 private void CalcItemPrice(ShopItemUI item)
 {
     if (shopData.masonryCount >= item.itemPrice)
     {
         Debug.Log("购买成功");
         //隐藏购买.
         item.BuyEnd();                                                                      //隐藏购买UI按钮.
         shopData.masonryCount -= item.itemPrice;                                            //减去已经消耗的钻石.
         UpdateUI();                                                                         //更新UI显示.
         shopData.UpdateXMLData(savePath, "MasonryCount", shopData.masonryCount.ToString()); //更新XML的钻石的数量.
         shopData.UpdateXMLData(savePath, "ID" + item.itemId, "1");                          //更新商品状态.
     }
     else
     {
         Debug.Log("购买失败,钻石不够");
     }
 }
Exemplo n.º 19
0
    //bool setItemBuyDone(int resid)
    //{
    //    if (mSecretItems.ContainsKey(resid))
    //    {
    //        ShopItemUI item = mSecretItems[resid];

    //        if (item != null)
    //        {
    //            item.SetBuyDone();
    //            return true;
    //        }
    //    }

    //    return false;
    //}

    bool setSecretItemInfo(int resid, ShopItemInfo info)
    {
        if (info == null || !mSecretItems.ContainsKey(resid))
        {
            return(false);
        }

        ShopItemUI item = mSecretItems[resid];

        if (item != null)
        {
            item.UpdateData(info);
            return(true);
        }

        return(false);
    }
Exemplo n.º 20
0
    void OnItemPurchased(int index)
    {
        Theme      theme  = themeDB.GetTheme(index);
        ShopItemUI uiItem = GetItemUI(index);

        if (GameDataManager.CanPurchaseTheme(theme.price))
        {
            themeDB.PurchaseTheme(index);
            uiItem.SetThemeAsPurchased();
            uiItem.OnItemSelect(index, OnItemSelected);

            GameDataManager.AddPurchasedTheme(index);
        }
        else
        {
            Debug.Log("Cant enough high score");
        }
    }
    //POPULA O SHOP JÁ CARREGADO NA INTERFACE
    public void PopulateInterface()
    {
        int i = 0;

        foreach (string key in GlobalVars.shopCache.lists.Keys)
        {
            ShopItemList list = GlobalVars.shopCache.lists[key];
            GameObject   go   = Instantiate(listPrefab);
            go.transform.SetParent(content.transform, false);

            ShopItemListUI listUI = go.GetComponent <ShopItemListUI>();
            listUI.listName = list.listName;

            RectTransform rect = go.GetComponent <RectTransform>();
            rect.offsetMin = new Vector2(0, -initialListY - 200 - listPeriod * i);
            rect.offsetMax = new Vector2(0, -initialListY + 200 - listPeriod * i);


            int   j    = 0;
            float size = 300;
            foreach (ShopItem item in list.items)
            {
                GameObject go2 = Instantiate(itemPrefab);
                go2.transform.SetParent(listUI.content.transform, false);

                ShopItemUI itemUI = go2.GetComponent <ShopItemUI>();
                itemUI.LoadShopItem(item);
                itemUI.canvas = canvas;

                RectTransform rect2 = go2.GetComponent <RectTransform>();
                rect2.offsetMin = new Vector2(j * size, 100);
                rect2.offsetMax = new Vector2(size + j * size, -100);

                RectTransform listContentRect = listUI.content.GetComponent <RectTransform>();
                listContentRect.offsetMax = new Vector2(listContentRect.offsetMax.x + size, 100);

                j++;
            }


            i++;
        }
    }
Exemplo n.º 22
0
    /// <summary>
    /// Figure out if item is available for purchase.
    /// </summary>
    /// <param name="item"></param>
    private void PurchaseAction(ShopItemUI item)
    {
        if (shopData.goldCount >= item.ItemPrice)
        {
            //Debug.Log("Purchase successful!");
            item.PurchaseDone();                                                          //Hide purchase button after finishing purchase.
            shopData.goldCount -= item.ItemPrice;                                         //Cost the gold while purchasing.
            UpdateUIData();                                                               //Update data in UI.

            shopData.UpdateXMLData(savePath, "GoldCount", shopData.goldCount.ToString()); //Update data in XML file.
            int status = shopData.shopStatus[index] = 1;
            shopData.UpdateXMLData(savePath, "ID" + item.ItemId, "1");

            m_StartUIManager.SetPlayButtonStatus(status);
        }
        else
        {
            //Debug.Log("Purchase failed.");
        }
    }
Exemplo n.º 23
0
 /// <summary>
 /// 计算商品价格
 /// </summary>
 private void CalcItemPrice(ShopItemUI item)
 {
     if (shopData.goldCount >= item.itemPrice)
     {
         Debug.Log("购买成功");
         //隐藏购买UI按钮
         item.BuyEnd();
         //减去所用的金币,更新UI
         shopData.goldCount -= item.itemPrice;
         UpdateUI();
         //更新XML中金币数量
         shopData.UpdateXMLData(savePath, "GoldCount", shopData.goldCount.ToString());
         //更新XML中商品状态
         shopData.UpdateXMLData(savePath, "ID" + item.itemId, "1");
     }
     else
     {
         Debug.Log("购买失败");
     }
 }
Exemplo n.º 24
0
 /// <summary>
 /// 判断可购买性
 /// </summary>
 /// <param name="Item"></param>
 private void CalaPrice(ShopItemUI ShopItemUI)
 {
     if (Xmldata.GemCount >= int.Parse(Xmldata.shopList[index].Price))
     {
         BroadcastMessage("BuyUIActiveAndAudio");//向该游戏物体及其子物体发送名字为的BuyUIActiveAndAudio消息
         Xmldata.GemCount -= int.Parse(Xmldata.shopList[index].Price);
         //更新UI
         GemNumber.text            = Xmldata.GemCount.ToString();
         m_UIManager.GemLabel.text = Xmldata.GemCount.ToString();
         //保存金币数据
         Xmldata.UpdateXMLData(savePath, "GemCount", GemNumber.text);
         //保存商品状态                      save中的
         Xmldata.UpdateXMLData(savePath, "ID" + ShopItemUI.ItemId, "1");
     }
     else
     {
         m_UIManager.HintUI.SetActive(true);//显示提示
         m_ShopUI.SetActive(false);
     }
 }
Exemplo n.º 25
0
    void GenerateShopItemsUI()
    {
        for (int i = 0; i < GameDataManager.GetAllPurchasedThemes().Count; i++)
        {
            int purchasedThemeIndex = GameDataManager.GetPurchasedTheme(i);
            themeDB.PurchaseTheme(purchasedThemeIndex);
        }


        itemHeight = shopItemsContainer.GetChild(0).GetComponent <RectTransform>().sizeDelta.y;
        Destroy(shopItemsContainer.GetChild(0).gameObject);

        shopItemsContainer.DetachChildren();

        for (int i = 0; i < themeDB.ThemesCount; i++)
        {
            Theme      theme  = themeDB.GetTheme(i);
            ShopItemUI uiItem = Instantiate(itemPrefab, shopItemsContainer).GetComponent <ShopItemUI>();

            uiItem.SetItemPosition(Vector2.down * i * (itemHeight + itemSpacing));
            uiItem.gameObject.name = "Theme " + i + "-" + theme.name;

            uiItem.SetThemeName(theme.name);
            uiItem.SetThemeImage(theme.image);
            uiItem.SetPriceText(theme.price);

            if (theme.isPurchased)
            {
                uiItem.SetThemeAsPurchased();
                uiItem.OnItemSelect(i, OnItemSelected);
            }
            else
            {
                uiItem.SetPriceText(theme.price);
                uiItem.OnItemPurchase(i, OnItemPurchased);
            }

            shopItemsContainer.GetComponent <RectTransform>().sizeDelta = Vector2.up * (itemHeight + itemSpacing) * themeDB.ThemesCount;
        }
    }
Exemplo n.º 26
0
    private void SetupList()
    {
        // SKINS
        skinUiList = new ShopItemUI[purchaseableSkins.Length + achievementSkins.Length];

        for (int i = 0; i < skinUiList.Length; i++)
        {
            ShopItemUI skinUiInst = Instantiate(shopItemPrefab);
            skinUiList[i] = skinUiInst;

            skinUiInst.cachedTrans.parent        = skinListStart;
            skinUiInst.cachedTrans.localPosition = new Vector3(0f, -i * spacing, 0f);
            skinUiInst.cachedTrans.localScale    = Vector3.one;

            skinUiInst.Init(this, ShopItemUI.Type.FrogSkin, i, GetSkin(i));
        }

        // Automatically own default skin.
        skinUiList[0].SetStatus(ShopItemUI.Status.Owned);

        // MAP THEMES
        mapThemeGroupTrans.localPosition = new Vector3(0f, (-skinUiList.Length * spacing) + skinGroupTrans.localPosition.y + mapThemeListOffsetY, 0f);
        mapThemeUiList = new ShopItemUI[purchaseableMapThemes.Length + achievementMapThemes.Length];

        for (int i = 0; i < mapThemeUiList.Length; i++)
        {
            ShopItemUI mapThemeUiInst = Instantiate(shopItemPrefab);
            mapThemeUiList[i] = mapThemeUiInst;

            mapThemeUiInst.cachedTrans.parent        = mapThemeListStart;
            mapThemeUiInst.cachedTrans.localPosition = new Vector3(0f, -i * spacing, 0f);
            mapThemeUiInst.cachedTrans.localScale    = Vector3.one;

            mapThemeUiInst.Init(this, ShopItemUI.Type.MapTheme, i, GetMapTheme(i));
        }

        // Automatically own default map theme.
        mapThemeUiList[0].SetStatus(ShopItemUI.Status.Owned);
    }
Exemplo n.º 27
0
    private void Awake()
    {
        List <ShopItemUI> shopItemUI =
            shopItemsTransform.GetComponentsInChildren <ShopItemUI>().ToList();

        while (shopItemUI.Count < shop.Items.Count)
        {
            ShopItemUI newShopItemUI = Instantiate(shopItemUIPrefab, shopItemsTransform);
            shopItemUI.Add(newShopItemUI);
        }

        while (shopItemUI.Count > shop.Items.Count)
        {
            int index = shopItemUI.Count - 1;
            Destroy(shopItemUI[index].gameObject);
            shopItemUI.RemoveAt(index);
        }

        for (int i = 0; i < shop.Items.Count; i++)
        {
            shopItemUI[i].Initialize(this, shop.Items[i]);
        }
    }
Exemplo n.º 28
0
    void Start()
    {
        xmlPath  = Resources.Load("ShopData").ToString();
        savePath = Application.persistentDataPath + @"/SaveData.xml";
        if (!File.Exists(savePath))
        {
            File.WriteAllText(savePath, content);
            Debug.Log("shopmanager创建" + xmlPath + savePath);
        }
        Debug.Log("shopmanager" + xmlPath + savePath);
        m_ShopUI      = GameObject.Find("Shop_UI");
        m_UIManager   = GameObject.Find("UI Root").GetComponent <UIManager>();
        m_CubeManager = GameObject.Find("CubeManager").GetComponent <CubeManager>();
        GemNumber     = GameObject.Find("GemNumber").GetComponent <UILabel>();


        m_LeftNext  = GameObject.Find("LeftNext");
        m_RightNext = GameObject.Find("RightNext");
        m_NextAudio = GameObject.Find("LeftNext").GetComponent <AudioSource>();//获取声音

        UIEventListener.Get(m_LeftNext).onClick  = LeftNextButtonClick;
        UIEventListener.Get(m_RightNext).onClick = RightNextButtonClick;

        ui_ShopItem  = Resources.Load <GameObject>("UI/ShopItem"); //加载资源
        m_ShopItemUI = ui_ShopItem.GetComponent <ShopItemUI>();    //获取脚本
        Xmldata      = new XmlData();                              //实例化商品对象
        Xmldata.ReadXmlPath(xmlPath);
        Xmldata.ReadGemAndScoreAndStateByPath(savePath);           //读取xml

        UpdateGemNumber();

        CreateShopUI();//创建商品模板
        //创建默认物体

        //SetPlayerInfo(Xmldata.shopList[0].Model);
    }
Exemplo n.º 29
0
    public void ToUI()
    {
        int j, k;

        for (int i = 0; i < materials.Length; i++)
        {
            j = i % 3;
            k = i / 3;

            if (i >= Contenedores.Count)
            {
                GameObject    go   = Instantiate(UIPrefab, Vector3.zero, Quaternion.identity, UIContenedor.transform);
                RectTransform gort = go.GetComponent <RectTransform>();

                gort.anchoredPosition = new Vector2(-355 + 355 * j, 400 - 355 * k);

                Contenedores.Add(go);
            }

            ShopItemUI mui = Contenedores[i].GetComponent <ShopItemUI>();
            //mui.material = materials[i];
            mui.UpdateUI();
        }
    }
Exemplo n.º 30
0
    void CreateMallItem(ShopTableItem item, ShopSubTable table = ShopSubTable.None)
    {
        GameObject go = WindowManager.Instance.CloneGameObject(mMallItemPrefab);

        if (go == null)
        {
            return;
        }

        go.SetActive(true);

        go.name = item == null ? "504" : item.resId.ToString();

        ShopItemUI shopItem = new ShopItemUI(go);

        switch (table)
        {
        case ShopSubTable.Sceret:
            go.transform.parent     = sGrid.transform;
            go.transform.localScale = Vector3.one;

            if (item == null)
            {
                mSecretItems.Add(mSecretItems.Count, shopItem);
            }
            else
            {
                mSecretItems.Add(item.resId, shopItem);
            }
            break;

        case ShopSubTable.Credit:
            go.transform.parent     = jGrid.transform;
            go.transform.localScale = Vector3.one;
            //mCreditItems.Add(shopItem);
            mCreditCount++;
            break;

        case ShopSubTable.Equip:
            go.transform.parent     = zGrid.transform;
            go.transform.localScale = Vector3.one;
            //mEquipItems.Add(shopItem);
            mEquipCount++;
            break;

        default:
            GameDebug.LogError("商店商品所在分栏错误");
            break;
        }

        if (item != null)
        {
            if (!mAllItemsLists.ContainsKey(item.resId))
            {
                mAllItemsLists.Add(item.resId, shopItem);
            }
        }

        shopItem.SetData(item);
        UIEventListener.Get(go).onClick = onMallItemClick;
    }