// Update is called once per frame void Update() { if (hand.Equals(HandType.LeftHand)) { if (Input.GetKey(KeyCode.Z)) { transform.Translate((-1) * moveSpeed * Time.deltaTime, 0, 0); } else if (Input.GetKey(KeyCode.C)) { transform.Translate(moveSpeed * Time.deltaTime, 0, 0); } } else if (hand.Equals(HandType.RightHand)) { if (Input.GetKey(KeyCode.B)) { transform.Translate((-1) * moveSpeed * Time.deltaTime, 0, 0); } else if (Input.GetKey(KeyCode.M)) { transform.Translate(moveSpeed * Time.deltaTime, 0, 0); } } }
public static SteamVR_Input_Sources GetDeviceFromHandType(HandType type) { if (type.Equals(HandType.Left)) { return(SteamVR_Input_Sources.LeftHand); } return(SteamVR_Input_Sources.RightHand); }