void DisablePanels() { foreach (GameObject obj in panels) { IPanel panel = obj.GetComponent <IPanel>(); if (panel.InScene()) { IEnumerator coroutine = panel.AnimateOut(); StartCoroutine(coroutine); } } }