| | |
| | | public event Action selectSkillEvent;
|
| | | public event Action talentPointUpdate;
|
| | | public event Action<int> talentSkillUpdate;
|
| | | public event Action<int> talentSkillLevelUp;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | if (talentSkills.ContainsKey(config.SkillTypeID))
|
| | | {
|
| | | var talentSkill = talentSkills[config.SkillTypeID];
|
| | | bool levelUp = talentSkill.level < config.SkillLV;
|
| | | talentSkill.level = config.SkillLV;
|
| | | if (talentSkillUpdate != null)
|
| | | {
|
| | | talentSkillUpdate(config.SkillTypeID);
|
| | | }
|
| | | if (levelUp && serverInited)
|
| | | {
|
| | | if (talentSkillLevelUp != null)
|
| | | {
|
| | | talentSkillLevelUp(config.SkillTypeID);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | public TalentConfig GetTalentConfig(int level = 0)
|
| | | {
|
| | | if (level > 0)
|
| | | {
|
| | | return Config.Instance.Get<TalentConfig>(skillId + level - 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | return Config.Instance.Get<TalentConfig>(skillId + level);
|
| | | }
|
| | | return Config.Instance.Get<TalentConfig>(skillId);
|
| | | }
|
| | | }
|
| | |
|