Example #1
0
    private void SetBtnLightAndDim(RankingType.ENUM btnType, string btnIcon, bool isLight)
    {
        int num = btnType - RankingType.ENUM.Lv;

        if (num >= 0 && num < this.btns.get_Count())
        {
            ButtonCustom buttonCustom = this.btns.get_Item(num);
            if (buttonCustom != null)
            {
                ResourceManager.SetSprite(buttonCustom.get_transform().GetComponent <Image>(), ResourceManager.GetIconSprite(btnIcon));
                buttonCustom.get_transform().FindChild("btnText").GetComponent <Text>().set_color((!isLight) ? this.COLOR_LIGHT_NO : this.COLOR_LIGHT);
            }
        }
    }
Example #2
0
    private void SetBtn(EquipLibType.ELT type, ButtonCustom btn, FXID fxID)
    {
        Dictionary <string, string> iconNamesByEquipPos = EquipGlobal.GetIconNamesByEquipPos(type, true);

        if (iconNamesByEquipPos == null)
        {
            return;
        }
        EquipLib             equipLibInfo         = EquipmentManager.Instance.equipmentData.equipLibs.Find((EquipLib a) => a.type == type);
        zZhuangBeiPeiZhiBiao zZhuangBeiPeiZhiBiao = DataReader <zZhuangBeiPeiZhiBiao> .Get(equipLibInfo.equips.Find((EquipSimpleInfo a) => a.equipId == equipLibInfo.wearingId).cfgId);

        ResourceManager.SetSprite(btn.get_transform().FindChild("Icon").FindChild("ImageFrame").GetComponent <Image>(), ResourceManager.GetIconSprite(iconNamesByEquipPos.get_Item("IconFrameName")));
        ResourceManager.SetSprite(btn.get_transform().FindChild("Icon").FindChild("ImageIcon").GetComponent <Image>(), ResourceManager.GetIconSprite(iconNamesByEquipPos.get_Item("IconName")));
        Text component = btn.get_transform().FindChild("Name").FindChild("Text").GetComponent <Text>();

        component.set_text(iconNamesByEquipPos.get_Item("ItemName"));
        if (equipLibInfo.lv > 0)
        {
            btn.get_transform().FindChild("Icon").FindChild("EquipLV").GetComponent <Text>().set_text("+" + equipLibInfo.lv);
        }
        else
        {
            btn.get_transform().FindChild("Icon").FindChild("EquipLV").GetComponent <Text>().set_text(string.Empty);
        }
        btn.get_transform().FindChild("TextLV").GetComponent <Text>().set_text("Lv." + zZhuangBeiPeiZhiBiao.level);
        int quality = int.Parse(iconNamesByEquipPos.get_Item("QualityLv"));
        Dictionary <string, Color> textColorByQuality = GameDataUtils.GetTextColorByQuality(quality);

        component.set_color(textColorByQuality.get_Item("TextColor"));
        component.GetComponent <Outline>().set_effectColor(textColorByQuality.get_Item("TextOutlineColor"));
        if (zZhuangBeiPeiZhiBiao.firstGroupId != 0)
        {
            if (fxID.fxid == 0)
            {
                fxID.fxid = FXSpineManager.Instance.PlaySpine(104, btn.get_transform().FindChild("Icon").FindChild("FX"), "EquipPartUI", 2001, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None);
            }
        }
        else if (fxID.fxid != 0)
        {
            FXSpineManager.Instance.DeleteSpine(fxID.fxid, true);
            fxID.fxid = 0;
        }
    }