Ejemplo n.º 1
0
 public static void AddMouseTrigger(MouseButton mouseButton, ButtonPosition buttonPosition, OnInputAction onInputAction)
 {
     if (!_mouseActions.ContainsKey(mouseButton))
     {
         _mouseActions.Add(mouseButton, new Dictionary <ButtonPosition, OnInputAction>());
     }
     if (!_mouseActions[mouseButton].ContainsKey(buttonPosition))
     {
         _mouseActions[mouseButton].Add(buttonPosition, onInputAction);
     }
     else
     {
         _mouseActions[mouseButton][buttonPosition] += onInputAction;
     }
 }
Ejemplo n.º 2
0
 public static void AddKeyboardTrigger(Key key, ButtonPosition buttonPosition, OnInputAction onInputAction)
 {
     if (!_keyboardActions.ContainsKey(key))
     {
         _keyboardActions.Add(key, new Dictionary <ButtonPosition, OnInputAction>());
     }
     if (!_keyboardActions[key].ContainsKey(buttonPosition))
     {
         _keyboardActions[key].Add(buttonPosition, onInputAction);
     }
     else
     {
         _keyboardActions[key][buttonPosition] += onInputAction;
     }
 }
Ejemplo n.º 3
0
 public static void RemoveKeyboardTrigger(Key key, ButtonPosition buttonPosition, OnInputAction onInputAction)
 {
     if (_keyboardActions.ContainsKey(key))
     {
         if (_keyboardActions[key].ContainsKey(buttonPosition))
         {
             _keyboardActions[key][buttonPosition] -= onInputAction;
             if (_keyboardActions[key][buttonPosition] == null)
             {
                 _keyboardActions[key].Remove(buttonPosition);
                 if (_keyboardActions[key].Count == 0)
                 {
                     _keyboardActions.Remove(key);
                 }
             }
         }
     }
 }
Ejemplo n.º 4
0
 public static void RemoveMouseTrigger(MouseButton mouseButton, ButtonPosition buttonPosition, OnInputAction onInputAction)
 {
     if (_mouseActions.ContainsKey(mouseButton))
     {
         if (_mouseActions[mouseButton].ContainsKey(buttonPosition))
         {
             _mouseActions[mouseButton][buttonPosition] -= onInputAction;
             if (_mouseActions[mouseButton][buttonPosition] == null)
             {
                 _mouseActions[mouseButton].Remove(buttonPosition);
                 if (_mouseActions[mouseButton].Count == 0)
                 {
                     _mouseActions.Remove(mouseButton);
                 }
             }
         }
     }
 }
Ejemplo n.º 5
0
 public static void RemoveMouseStillTrigger(OnInputAction onInputAction)
 {
     _onMouseStill -= onInputAction;
 }
Ejemplo n.º 6
0
 public static void AddMouseStillTrigger(OnInputAction onInputAction)
 {
     _onMouseStill += onInputAction;
 }
Ejemplo n.º 7
0
 public static void RemoveMouseMoveTrigger(OnInputAction onInputAction)
 {
     _onMouseMove -= onInputAction;
 }
Ejemplo n.º 8
0
 public static void AddMouseMoveTrigger(OnInputAction onInputAction)
 {
     _onMouseMove += onInputAction;
 }