protected override void SetOneSkill(int cellIndex, int talentId, int talentLv, int nextTalentLv)
    {
        Transform    child      = base.get_transform().GetChild(cellIndex);
        Text         component  = child.FindChild("texName").GetComponent <Text>();
        Text         component2 = child.FindChild("texLv").GetComponent <Text>();
        Text         component3 = child.FindChild("texNeedLv").GetComponent <Text>();
        Text         component4 = child.FindChild("texDesc").GetComponent <Text>();
        Image        component5 = child.FindChild("imgNatural").GetComponent <Image>();
        Image        component6 = child.FindChild("imgMaterial").GetComponent <Image>();
        Text         component7 = child.FindChild("texMaterial").GetComponent <Text>();
        ButtonCustom component8 = child.FindChild("btnLvUp").GetComponent <ButtonCustom>();
        string       desc       = PetEvoGlobal.GetDesc(talentId);

        if (PetEvoGlobal.IsEnoughStar(PetBasicUIViewModel.PetID, talentId))
        {
            component.set_text(PetEvoGlobal.GetName(talentId));
            component4.set_text(desc);
            component4.set_color(new Color32(165, 90, 65, 255));
            ImageColorMgr.SetImageColor(component5, false);
        }
        else
        {
            string        text          = string.Empty;
            int           requireStar   = PetEvoGlobal.GetRequireStar(PetBasicUIViewModel.PetID, talentId);
            PetConversion petConversion = DataReader <PetConversion> .Get(requireStar);

            if (petConversion != null)
            {
                text = string.Format(GameDataUtils.GetChineseContent(400018, false), petConversion.tianfuSuffix);
                component.set_text(PetEvoGlobal.GetName(talentId) + text);
            }
            component4.set_text(TextColorMgr.FilterColor(desc));
            component4.set_color(Color.get_gray());
            ImageColorMgr.SetImageColor(component5, true);
        }
        component3.get_gameObject().SetActive(false);
        component2.get_gameObject().SetActive(false);
        component8.get_gameObject().SetActive(false);
        component6.get_gameObject().SetActive(false);
        component7.get_gameObject().SetActive(false);
    }
Exemple #2
0
 public static bool IsEnoughStar(int petId, int talentId)
 {
     return(PetEvoGlobal.GetPetStar(petId) >= PetEvoGlobal.GetRequireStar(petId, talentId));
 }