public void Examine(Collider2D[] frontObjects) { foreach (Collider2D frontObject in frontObjects) { Selectable selectableObject = frontObject.GetComponent <Selectable>(); if (selectableObject != null) { selectableObject.Examine(); break; } } }