public int GetLevel(int cfgId) { RoleTalentInfo talentInfo = this.GetTalentInfo(cfgId); if (talentInfo != null) { return(talentInfo.lv); } return(0); }
public void UpdateTalentInfo(RoleTalentInfo info) { for (int i = 0; i < this.RoleTalentInfos.get_Count(); i++) { if (this.RoleTalentInfos.get_Item(i).cfgId == info.cfgId) { this.RoleTalentInfos.set_Item(i, info); this.RefreshTalentTemplates(); return; } } this.RoleTalentInfos.Add(info); this.RefreshTalentTemplates(); }
private void RefreshTalentTemplates() { this.ResetTalentTemplatesData(); for (int i = 0; i < this.RoleTalentInfos.get_Count(); i++) { RoleTalentInfo roleTalentInfo = this.RoleTalentInfos.get_Item(i); Talent data = this.GetData(roleTalentInfo.cfgId, roleTalentInfo.lv); if (data != null) { if (data.templateId > 0) { talent_template talent_template = DataReader <talent_template> .Get(data.templateId); if (talent_template == null) { Debug.LogError("GameData.talent_template no exist, id = " + data.templateId); } else if (!this.RefreshInitActPoint(talent_template)) { if (!this.RefreshSkillTypeCDOffsets(talent_template)) { if (!this.RefreshSkillTypeActPointOffsets(talent_template)) { if (!this.RefreshSkillTypeExistTimeOffsets(talent_template)) { if (this.RefreshPassiveSkillIDs(talent_template)) { } } } } } } } } }
public bool IsActivationReach(int cfgId, int level) { RoleTalentInfo talentInfo = this.GetTalentInfo(cfgId); return(talentInfo != null && talentInfo.lv >= level); }