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)
    {
        _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
 private void ChangeLevel(UpgradeableSkill skill, int newLevel)
 {
     _levelText.text = newLevel.ToString();
 }