public async void Toggle() { if (menuPool.IsAnyMenuOpen()) { menuPool.CloseAllMenus(); } else { mainMenu.Visible = true; while (menuPool.IsAnyMenuOpen()) { menuPool.ProcessMenus(); menuPool.ProcessMouse(); await BaseScript.Delay(0); } } }