Example #1
0
    public void Upskill(int skillCode)
    {
        SkillInfo skillInfo = null;

        foreach (var skill in allSkills)
        {
            if (skill.skillCode == skillCode)
            {
                skillInfo = skill;
                break;
            }
        }

        if (accuiredSkill.ContainsKey(skillInfo))
        {
            accuiredSkill[skillInfo] += 1;
        }
        else
        {
            accuiredSkill.Add(skillInfo, 1);
        }


        GetRandomSkillSet();

        // Decrease coin per amount use to up skill
        int oldCoinNeeded = coinNeededToUpSkill;

        coinNeededToUpSkill += coinUpPerSkill;
        coinSystem.UpdateCoin(-oldCoinNeeded);
        SkillSetShow();

        TriggerOpenOrCloseSkillPanle();
        statsShow.OnUpGradeSkill(accuiredSkill);
    }
 public void StoreItemInInventory(int itemCode)
 {
     if (itemCode == 0)
     {
         if (coinSystem == null)
         {
             Debug.LogWarning("No coin system instance...");
         }
         else
         {
             coinSystem.UpdateCoin(1);
         }
     }
     else
     {
         inventorySystem.AddItem(itemCode);
     }
 }