public static bool GetKey(MyKeyCode c) { if (!mKeyStateMap.ContainsKey(c)) { return(false); } return(mKeyStateMap[c] == MyKeyState.Down || mKeyStateMap[c] == MyKeyState.Held); }
public bool IsKeyHeld(MyKeyCode key) { if (isInitialized) { return(keyHeld[key]); } return(false); }
public static bool GetKeyUp(MyKeyCode c) { if (!mKeyStateMap.ContainsKey(c)) { return(false); } return(mKeyStateMap[c] == MyKeyState.Up); }
public static void SetKeyUp(MyKeyCode c) { if (!mKeyStateMap.ContainsKey(c)) { mKeyStateMap.Add(c, MyKeyState.Up); shouldUpdate.Add(c, false); } mKeyStateMap[c] = MyKeyState.Up; shouldUpdate[c] = false; }
private void RotateChange(MyKeyCode key) { if (key.Equals(MyKeyCode.Left)) { ParticleSystem.shape.rotation.Set(0, 0, 75); } else { ParticleSystem.shape.rotation.Set(0, 0, -75); } }
public static bool GetKeyUp(MyKeyCode code) { if (!IsInputEnabled()) { return(false); } else { return(Input.GetKeyUp((KeyCode)code)); } }
///<summary> ///True if you want to register Action on Key Down. False if on Key Up. ///</summary> public void RegisterKeyAction(MyKeyCode key, bool state, Action action) { if (!isInitialized) { InitKeysDict(); } if (state) { keyDownActions[key].Register(action); } else { keyUpActions[key].Register(action); } }
///<summary> ///True if you want to unregister Action on Key Down. False if on Key Up. ///</summary> public void UnregisterKeyAction(MyKeyCode key, bool state, Action action) { if (state) { if (keyDownActions.ContainsKey(key)) { keyDownActions[key].Unregister(action); } } else { if (keyUpActions.ContainsKey(key)) { keyUpActions[key].Unregister(action); } } }
public static bool IsKeyHeld(this MyKeyCode key) { return(STF.GameManager.InputController.IsKeyHeld(key)); }
public bool IsKeyHeld(MyKeyCode key) { return(keyHeld[key]); }