Exemplo n.º 1
0
    private IEnumerator tempShowMessage(UIBagItem ubi)
    {
        ubi.ShowMessage();
        yield return(new WaitForSeconds(1f));

        ubi.HideMessage();
    }
Exemplo n.º 2
0
    void ShowBagItemByType(ShopItemType type)
    {
        if (null != m_prefab)
        {
            if (Skins.Count > m_bagItems.Count)
            {
                for (int i = m_bagItems.Count; i < Skins.Count; i++)
                {
                    GameObject uiObject = (GameObject)GameObject.Instantiate(m_prefab);
                    uiObject.transform.SetParent(m_parent);
                    uiObject.transform.localScale = Vector3.one;
                    UIBagItem item = Util.AddComponent <UIBagItem>(uiObject);
                    m_bagItems.Add(item);
                }
            }


            for (int i = 0; i < m_bagItems.Count; i++)
            {
                if (i < Skins.Count)
                {
                    int       val  = Skins[i];
                    EquipInfo info = InfoMgr <EquipInfo> .Instance.GetInfo(val);

                    if (null != info)
                    {
                        if (type == ShopItemType.ShopItem_ALL)
                        {
                            m_bagItems[i].SetBagItemInfo(info);
                            Util.SetActive(m_bagItems[i].Cache, true);
                        }
                        else
                        {
                            if (info.equipType + 1 == (int)type)
                            {
                                m_bagItems[i].SetBagItemInfo(info);
                                Util.SetActive(m_bagItems[i].Cache, true);
                            }
                            else
                            {
                                Util.SetActive(m_bagItems[i].Cache, false);
                            }
                        }
                    }
                    else
                    {
                        Util.SetActive(m_bagItems[i].Cache, false);
                    }
                }
                else
                {
                    Util.SetActive(m_bagItems[i].Cache, false);
                }
            }
        }
    }
Exemplo n.º 3
0
    public void OnPickupItem(Item item)
    {
        GameObject go = (GameObject)Instantiate(BagItemPrefab, BagContent.transform);

        go.transform.localEulerAngles = Vector3.one;
        UIBagItem ubi = go.GetComponent <UIBagItem>();

        bagItemDic.Add(item, ubi);
        ubi.SetItem(item);
        StartCoroutine(tempShowMessage(ubi));
    }