private void UpgradeSkillWhenColorUp(PetInfo pet) { var maxSkills = player.resource.petParameters.activeSkillCountTable[pet.color]; if (maxSkills > pet.skills.Count) { int count = maxSkills - pet.skills.Count; List <PetActiveSkill> newSkills = player.resource.petSkills.GetRandomSkills(count, pet.skills); if (newSkills.Count > 0) { foreach (var skill in newSkills) { pet.AddActiveSkill(skill); } } } }