public void SetKeyBind(KeyBindName bindName, KeyCode keyCode) { if (this.KeyBinds.ContainsValue(keyCode)) { this.KeyBinds[this.KeyBinds.FirstOrDefault(b => b.Value == keyCode).Key] = KeyCode.None; } this.KeyBinds[bindName] = keyCode; }
public KeyCode GetKeyBindValue(KeyBindName bindName) { if (this.KeyBinds.TryGetValue(bindName, out var keyCode)) { return(keyCode); } return(KeyCode.None); }