/// <summary> /// Infinite loop to check for new entries and add them to the UI /// </summary> /// <returns></returns> private IEnumerator CleanUpEntries() { cleanUpLoopRunning = true; while (true) { MenuManager mm = FindObjectOfType <MenuManager>(); if (mm != null) { mm.CleanLANServersList(); if (serverEntries.Count > 0) { int i = 0; foreach (LanEntry server in serverEntries) { i++; mm.AddLANServerSlot(server); } } } yield return(new WaitForSeconds(TIMEOUT)); } }