Exemple #1
0
    private void Update()
    {
        if ((Input.GetKeyDown(KeyCode.Escape) || Input.GetButtonDown("InterfaceCancel")) && keyToModify == null)
        {
            Back();
        }

        //if there is a key that needs to be modified, ask the user to activate
        //an input unil he does. Once he does, set the input to the key being modified
        if (keyToModify != null)
        {
            //display message
            chooseInput.enabled = true;

            //see if an input is activated
            Key temp = Key.ActivatedKey();

            //if one is, set the key being modifed to it
            if (temp != null)
            {
                keyToModify.ChangeValue(temp);
                keyToModify = null;
                Refresh();
            }
        }
        else
        {
            //hide message
            chooseInput.enabled = false;
        }
    }