private void CreateKeyBinding(string _actionMethodName, string _description, string _defaultPrimary, bool _defaultMod1Primary, bool _defaultMod2Primary, bool _defaultMod3Primary, string _defaultSecondary, bool _defaultMod1Secondary, bool _defaultMod2Secondary, bool _defaultMod3Secondary, bool _defaultIncludeInCheatsheet = false) { KeyCode[] keyCodes = new KeyCode[2]; keyCodes[0] = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString(_actionMethodName + "PrimaryKey", _defaultPrimary)); keyCodes[1] = (KeyCode)System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString(_actionMethodName + "SecondaryKey", _defaultSecondary)); bool[] modifierListPrimary = new bool[3]; bool[] modifierListSecondary = new bool[3]; int parsedModInt = 0; if (int.TryParse(PlayerPrefs.GetString(_actionMethodName + "ModifierListCodePrimary", KeyBinding.ParseModiferListAsInt(_defaultMod1Primary, _defaultMod2Primary, _defaultMod3Primary).ToString()), out parsedModInt)) { ; } else { Debug.Log("Error parsing primary modifier list code! - _actionMethodName: " + _actionMethodName); } modifierListPrimary = KeyBinding.ParseIntAsModiferList(parsedModInt); if (int.TryParse(PlayerPrefs.GetString(_actionMethodName + "ModifierListCodeSecondary", KeyBinding.ParseModiferListAsInt(_defaultMod1Secondary, _defaultMod2Secondary, _defaultMod3Secondary).ToString()), out parsedModInt)) { ; } else { Debug.Log("Error parsing secondary modifier list code! - _actionMethodName: " + _actionMethodName); } modifierListSecondary = KeyBinding.ParseIntAsModiferList(parsedModInt); bool _includeInCheatsheet = false; Boolean.TryParse(PlayerPrefs.GetString(_actionMethodName + "IncludeInCheatsheet", _defaultIncludeInCheatsheet.ToString()), out _includeInCheatsheet); KeyBinding workingKeyBinding = new KeyBinding(_actionMethodName, _description, keyCodes[0], modifierListPrimary[0], modifierListPrimary[1], modifierListPrimary[2], keyCodes[1], modifierListSecondary[0], modifierListSecondary[1], modifierListSecondary[2], _includeInCheatsheet); keyBindings.Add(_actionMethodName, workingKeyBinding); defaultKeyBindings.Add(_actionMethodName, new KeyBinding(_actionMethodName, _description, (KeyCode)System.Enum.Parse(typeof(KeyCode), _defaultPrimary), _defaultMod1Primary, _defaultMod2Primary, _defaultMod3Primary, (KeyCode)System.Enum.Parse(typeof(KeyCode), _defaultSecondary), _defaultMod1Secondary, _defaultMod2Secondary, _defaultMod3Secondary, _defaultIncludeInCheatsheet)); workingKeyBinding.AssignKeybindComposite(KeyBinder.keyBinder.CreateKeyBindingComposite(_actionMethodName, _description, keyCodes[0].ToString(), modifierListPrimary[0], modifierListPrimary[1], modifierListPrimary[2], keyCodes[1].ToString(), modifierListSecondary[0], modifierListSecondary[1], modifierListSecondary[2], _includeInCheatsheet)); }