void setSkillViewAge(Skill skill) { foreach (Transform child in buttonContainer.transform) { SkillButton sb = child.GetComponent <SkillButton>(); if (sb != null && sb.skill != null && sb.skill == skill) { var x = ((Time.time - skill.startedTime) - (skill.timeUntilDisappearSec * 0.5f)) / (skill.timeUntilDisappearSec * 0.5f); sb.setAge(x); } } }