private void ProcessKeyString(ref KeyCode key, ref bool isEditing) { if (isEditing && Event.current.type == EventType.KeyUp) { key = AxisConfiguration.StringToKey(_keyString); if (key == KeyCode.None) { _keyString = string.Empty; } else { _keyString = key.ToString(); } isEditing = false; } }
private void ProcessKeyString(ref bool isEditing, SerializedProperty key) { if (isEditing && Event.current.type == EventType.KeyUp) { KeyCode keyCode = AxisConfiguration.StringToKey(_keyString); if (keyCode == KeyCode.None) { key.enumValueIndex = 0; _keyString = string.Empty; } else { key.enumValueIndex = IndexOfKeyName(key.enumNames, _keyString); _keyString = keyCode.ToString(); } } }
private KeyCode PropertyToKeyCode(SerializedProperty key) { return(AxisConfiguration.StringToKey(key.enumNames[key.enumValueIndex])); }