void InitButton(KeyBindingNames binding, string s) { TextButton temp = Instantiate <TextButton>(hotkeyButtonPrefab, buttonContainer.contentTransform); temp.ChangeText(s); temp.button.onClick.AddListener(delegate { RebindDelagate(binding); }); buttonlabels.Add(temp); }
public bool IsKeyPressed(KeyBindingNames nameOfKey) { if (hotkeys.hotkeys.ContainsKey(nameOfKey)) { return(Input.GetKeyDown(hotkeys.hotkeys[nameOfKey])); } else { Debug.Log("Key not assigned: " + nameOfKey); return(false); } }
public RebindState(BoardManager boardManager, KeyBindingNames currBinding) : base(boardManager) { this.currBinding = currBinding; }
void RebindDelagate(KeyBindingNames binding) { board.inputFSM.SwitchState(new RebindState(board, binding)); }
public string GetBindingNames(KeyBindingNames k) { return(bindingNames[k]); }
public void InitButton(BoardManager board, KeyBindingNames currBindings) { this.board = board; this.currBindings = currBindings; }