Beispiel #1
0
    public void SetData(GuildMake parent, GuildShopMakeItem data)
    {
        m_parent = parent;
        m_data   = data;

        if (data.IsValid())
        {
            Tab_CommonItem tabCommonItem = TableManager.GetCommonItemByID(data.m_ItemID, 0);
            if (tabCommonItem == null)
            {
                return;
            }
            if (SpriteQuality != null)
            {
                SpriteQuality.spriteName = GlobeVar.QualityColorGrid[tabCommonItem.Quality - 1];
            }

            if (SpriteIcon != null)
            {
                SpriteIcon.spriteName = tabCommonItem.Icon;
            }

            if (LabelName != null)
            {
                LabelName.text = tabCommonItem.Name;
            }

            if (LableDesc != null)
            {
                LableDesc.text = Utils.GetDicByID(data.m_DictID);
            }
        }
    }
Beispiel #2
0
    public static GuildMakeItem CreateItem(GameObject grid, GameObject resObj, string name, GuildMake parent, GuildShopMakeItem data)
    {
        GameObject curItem = Utils.BindObjToParent(resObj, grid);

        if (null != curItem)
        {
            GuildMakeItem curItemComponent = curItem.GetComponent <GuildMakeItem>();
            if (null != curItemComponent)
            {
                curItemComponent.SetData(parent, data);
            }
            return(curItemComponent);
        }

        return(null);
    }