public void Show() { UpdateArmy(); Person person = Person; icon.sprite = person.icon; int i; for (i = 0; i < person.Skills.Length; i++) { Skill skill = person.Skills[i]; SkillButton button = skillsButton[i]; button.gameObject.SetActive(true); button.RemoveAllListeners(); button.AddListener(() => skill.Cast()); button.AddListener(() => UpdatePropertyAndSkills()); int j = i; button.AddUpgradeListener(() => person.LearnSkill(j)); button.AddUpgradeListener(() => UpdatePropertyAndSkills()); button.SetSkill(skill, (s) => s.Person.lvlPoint > 0 && s.GetLevel != s.GetMaxLevel); } for (; i < skillsButton.Length; i++) { skillsButton[i].gameObject.SetActive(false); } name.text = person.name; UpdatePropertyAndSkills(); }