Exemplo n.º 1
0
 void ChangeLevel(UpgradeableSkill skill, int newLevel)
 {
     for (int i = 0; i < _skills.Length; i++)
     {
         if (_skills[i] == skill)
         {
             data.skills[i] = newLevel;
             break;
         }
     }
 }
Exemplo n.º 2
0
 public void CmdUpgradeSkill(int index)
 {
     if (Player.Progress.RemoveSkillPoint())
     {
         UpgradeableSkill skill = Player.Character.unitSkills[index] as UpgradeableSkill;
         if (skill != null)
         {
             skill.level++;
         }
     }
 }
Exemplo n.º 3
0
 public void SetSkill(UpgradeableSkill skill)
 {
     if (skill != null)
     {
         icon.sprite       = skill.icon;
         skill.onSetLevel += ChangeLevel;
         ChangeLevel(skill, skill.level);
         gameObject.SetActive(true);
     }
     else
     {
         gameObject.SetActive(false);
     }
 }
Exemplo n.º 4
0
 public void Load(UserData data)
 {
     this.data = data;
     for (int i = 0; i < _skills.Length; i++)
     {
         UpgradeableSkill skill = _skills[i] as UpgradeableSkill;
         if (i >= data.skills.Count)
         {
             data.skills.Add(skill.level);
         }
         else
         {
             skill.level = data.skills[i];
         }
         skill.onSetLevel += ChangeLevel;
     }
 }
Exemplo n.º 5
0
 void ChangeLevel(UpgradeableSkill skill, int newLevel)
 {
     levelText.text = newLevel.ToString();
 }