private IEnumerator SkillLevelUpRun(int id, App.Model.MSkill mSkill) { SSkill sSkill = new SSkill(); yield return(StartCoroutine(sSkill.RequestLevelUp(id))); mSkill.Update(sSkill.skill); }
public void SkillLevelUp(int id) { App.Model.MSkill mSkill = System.Array.Find(character.Skills, s => s.Id == id); if (Global.SUser.self.Silver < mSkill.Master.price) { CAlertDialog.Show("银两不够"); return; } StartCoroutine(SkillLevelUpRun(id, mSkill)); }
public void AddCharacterSkill(int characterId, App.Model.Belong belong, int skillId, int skillLevel) { MCharacter mCharacter = System.Array.Find(mBaseMap.Characters, c => c.CharacterId == characterId && c.Belong == belong); App.Model.MSkill mSkill = new App.Model.MSkill(); mSkill.Id = mCharacter.Skills[mCharacter.Skills.Length - 1].Id + 1; mSkill.SkillId = skillId; mSkill.Level = skillLevel; List <App.Model.MSkill> skills = mCharacter.Skills.ToList(); skills.Add(mSkill); mCharacter.Skills = skills.ToArray(); if (App.Model.Master.MSkill.IsSkillType(mSkill.Master, App.Model.SkillType.ability)) { int hp = mCharacter.Hp; int mp = mCharacter.Mp; mCharacter.StatusInit(); mCharacter.Hp = hp + mSkill.Master.hp; mCharacter.Mp = mp + mSkill.Master.mp; } }
public void Update(MSkill skill) { this.Level = skill.Level; }