private void _PressAnyKey() { if (BindingUtils.GetAnyPressedKey() != KeyCode.None) { anim.enabled = true; UI[1].SetActive(false); StartCoroutine(PressAnyAnimation()); } }
private void Update() { if (isRebinding) { KeyCode pressed = BindingUtils.GetAnyPressedKey(); if (pressed != KeyCode.None) { BindingManager.Rebind(bindingToMap, pressed); BindingUtils.UpdateTextWithBinding(bindingToMap, buttonText); isRebinding = false; } } }
// Update is called once per frame void Update() { // Are we rebinding the key? if (isRebinding) { // Try to get any key in the input and check if it was sucessful KeyCode pressed = BindingUtils.GetAnyPressedKey(); if (pressed != KeyCode.None) { // Rebind the key and update the button text BindingManager.Rebind(bindingToMap, pressed); BindingUtils.UpdateTextWithBinding(bindingToMap, buttonText); // Reset the isRebinding flag as we have now rebound the key isRebinding = false; } } }