public override bool Equals(object obj) { if (obj == null) { return(false); } ExperienceCard attr = obj as ExperienceCard; if ((object)attr == null) { return(false); } return(tableModel == attr.tableModel); }
/* * If the GameObject is an Experience Card, activate it. * If another card was already active, deactivate it. */ private void TryActivateExperienceCard(GameObject go) { if (go != null) { var experienceCard = go.GetComponentInChildren <ExperienceCard>(); if (experienceCard != null) { experienceCard.Activate(); if (previousCard != null && !previousCard.Equals(experienceCard)) { previousCard.Deactivate(); } previousCard = experienceCard; } } }