public static void RemoveTalent(BaseEotETalent talentToRemove) { foreach (var talent in talentsLearned) { if (talent.GetType() == talentToRemove.GetType()) { if (talent.RankedTalent) { if (talent.TalentRank > 1) { talent.TalentRank -= 1; return; } talentsLearned.Remove(talent); return; } else { Debug.Log("THIS SHOULD NOT HAPPEN. CHECK ME: " + talent.TalentName); return; } } } talentsLearned.Remove(talentToRemove); return; //var first = talentsLearned.OfType<>() }
public static void AddTalent(BaseEotETalent talentToAdd) { foreach (var talent in talentsLearned) { if(talent.GetType() == talentToAdd.GetType()) { if (talent.RankedTalent) { talent.TalentRank += 1; return; } else { Debug.Log("THIS SHOULD NOT HAPPEN. CHECK ME: " + talent.TalentName); return; } } } talentToAdd.TalentRank = 1; talentsLearned.Add(talentToAdd); return; //var first = talentsLearned.OfType<>() }