//wait for input, then update values and return to the main options menu IEnumerator AssignKey(string controlKey) { waitingForKeyPress = true; yield return(WaitForKey()); CustomController.SetButton(controlKey, newKey); CustomController.SaveAllKeys(); UpdateButtonText(); KeyPressSubMenu.SetActive(false); if (gameManager != null) { gameManager.DontAllowPause = false; } yield return(null); }