private void CheckLeftOrRightContoller(MessageObject obj) { ETrackedControllerRole trackerdRole = ETrackedControllerRole.Invalid; var system = Valve.VR.OpenVR.System; if (system != null && null != trackedController) { trackerdRole = system.GetControllerRoleForTrackedDeviceIndex(trackedController.controllerIndex); } #region use by string name as legacy #if By_Name_String controllerType = HandleControllerType.Invalid; if (this.name.Contains("left")) { controllerType = HandleControllerType.LeftHand; } if (this.name.Contains("right")) { controllerType = HandleControllerType.RightHand; } #endif #endregion controllerType = (HandleControllerType)((int)trackerdRole); }
private void CheckLeftOrRightContoller(MessageObject obj) { ETrackedControllerRole trackerdRole = ETrackedControllerRole.Invalid; var system = Valve.VR.OpenVR.System; if (system != null && null != trackedController) { trackerdRole = system.GetControllerRoleForTrackedDeviceIndex(trackedController.controllerIndex); } controllerType = (HandleControllerType)((int)trackerdRole); }
private void CheckLeftOrRightContoller(MessageObject obj) { controllerType = HandleControllerType.Invalid; if (this.name.Contains("left")) { controllerType = HandleControllerType.LeftHand; } if (this.name.Contains("right")) { controllerType = HandleControllerType.RightHand; } }