示例#1
0
 /// <summary>
 /// Add a button to a specified input
 /// </summary>
 /// <param name="keyName"></param>
 /// <param name="linkedButton"></param>
 public static void AddKey(InputAction ia, Button linkedButton)
 {
     input[ia].Add(linkedButton);
 }
示例#2
0
 /// <summary>
 /// Insert a button to a specified input into the input list, potentially replacing an old one.
 /// </summary>
 /// <param name="keyName"></param>
 /// <param name="linkedButton"></param>
 /// <param name="position"></param>
 public static void InsertKey(InputAction ia, Button linkedButton, int position)
 {
     if (linkedButton == null || linkedButton.Key == Keys.Enter || linkedButton.Key == Keys.Escape)
     {
         return;
     }
     if (input[ia].Count <= position)
     {
         AddKey(ia, linkedButton);
     }
     else
     {
         if (input[ia][position].Key != Keys.Escape && input[ia][position].Key != Keys.Enter)
         {
             input[ia][position] = linkedButton;
         }
     }
 }