コード例 #1
0
    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);
    }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
ファイル: RebindState.cs プロジェクト: Tathomp/TacticsGame
 public RebindState(BoardManager boardManager, KeyBindingNames currBinding)
     : base(boardManager)
 {
     this.currBinding = currBinding;
 }
コード例 #4
0
 void RebindDelagate(KeyBindingNames binding)
 {
     board.inputFSM.SwitchState(new RebindState(board, binding));
 }
コード例 #5
0
 public string GetBindingNames(KeyBindingNames k)
 {
     return(bindingNames[k]);
 }
コード例 #6
0
 public void InitButton(BoardManager board, KeyBindingNames currBindings)
 {
     this.board        = board;
     this.currBindings = currBindings;
 }