Exemple #1
0
 public static void Enable(IList <KBind> KeyBinds)
 {
     if (KeyBinds.Count > 0 && !AppInput.HasKeyBind(KeyBinds[0]))
     {
         for (int i = 0; i < KeyBinds.Count; ++i)
         {
             AppInput.AddListener(KeyBinds[i]);
         }
     }
 }
 public static void OnEnable(IList <AxBind> AxisBinds)
 {
     if (AxisBinds.Count > 0 && !AppInput.HasAxisBind(AxisBinds[0]))
     {
         for (int i = 0; i < AxisBinds.Count; ++i)
         {
             AppInput.AddListener(AxisBinds[i]);
         }
     }
 }
Exemple #3
0
 private void OnEnable()
 {
     if (keyBinds.Count > 0 && !AppInput.HasKeyBind(keyBinds[0]))
     {
         for (int i = 0; i < keyBinds.Count; ++i)
         {
             AppInput.AddListener(keyBinds[i]);
         }
     }
     if (axisBinds.Count > 0 && !AppInput.HasAxisBind(axisBinds[0]))
     {
         for (int i = 0; i < axisBinds.Count; ++i)
         {
             AppInput.AddListener(axisBinds[i]);
         }
     }
 }
Exemple #4
0
        public int AddListener(KBind kBind)
        {
            int index = KeyBinds.FindIndex(kb => kb.name == kBind.name);

            if (index >= 0)
            {
                KeyBinds[index] = kBind;
            }
            else
            {
                index = KeyBinds.Count;
                KeyBinds.Add(kBind);
            }
            if (enabled)
            {
                AppInput.AddListener(kBind);
            }
            return(index);
        }