void Update() { eou.Init(); eou.AutoExitOnQuit(); var l = eou.GetLeftControllerTransform(); var r = eou.GetRightControllerTransform(); eou.SetGameObjectLocalTransform(ref LeftController, eou.GetLeftControllerTransform()); eou.SetGameObjectLocalTransform(ref RightController, r); }
// Update is called once per frame void Update() { eou.Init(); eou.AutoExitOnQuit(); var t = eou.GetTransformBySerialNumber(serialNumber); if (offset == null) { offset = t; } eou.SetGameObjectLocalTransformWithOffset(ref Tracker, t, offset); Debug.Log(t.ToString()); }
void Update() { if (!eou.IsReady()) { eou.StartOpenVR(); } if (HMD_Offset == null || LeftHand_Offset == null || RightHand_Offset == null) { HMD_Offset = eou.GetHMDTransform(); LeftHand_Offset = eou.GetLeftControllerTransform(); RightHand_Offset = eou.GetRightControllerTransform(); } eou.AutoExitOnQuit(); _config = configManager.GetConfig(); HMDTrans = eou.GetHMDTransform(); LeftHandTrans = eou.GetLeftControllerTransform(); RightHandTrans = eou.GetRightControllerTransform(); eou.SetGameObjectTransform(ref HMD, HMDTrans); eou.SetGameObjectTransform(ref LeftHand, LeftHandTrans); eou.SetGameObjectTransform(ref RightHand, RightHandTrans); eou.SetGameObjectTransformWithOffset(ref HMD_withOffset, HMDTrans, HMD_Offset); eou.SetGameObjectTransformWithOffset(ref LeftHand_withOffset, LeftHandTrans, LeftHand_Offset); eou.SetGameObjectTransformWithOffset(ref RightHand_withOffset, RightHandTrans, RightHand_Offset); ulong button; if (isFollowRightHand) { eou.GetControllerButtonPressed(eou.GetRightControllerIndex(), out button); } else { eou.GetControllerButtonPressed(eou.GetLeftControllerIndex(), out button); } if (button != 0) { V_Chest.SetActive(false); V_Foot_L.SetActive(false); V_Foot_R.SetActive(false); V_Offset.SetActive(false); } if (_config.isMenuLeftHand && LeftHandTrans != null && LeftHandTrans.velocity.y < -3.5f || _config.isMenuRightHand && RightHandTrans != null && RightHandTrans.velocity.y < -3.5f) { if (!MenuManager.IsActive() && (!_config.isMenuLock || _config.MenuLockButton == 0 || _config.MenuLockButton == button)) { MenuManager.Open(); } } else if (_config.isMenuLeftHand && LeftHandTrans != null && LeftHandTrans.velocity.y > 3.5f || _config.isMenuRightHand && RightHandTrans != null && RightHandTrans.velocity.y > 3.5f) { if (MenuManager.IsActive() && (!_config.isMenuLock || _config.MenuLockButton == 0 || _config.MenuLockButton == button)) { MenuManager.Close(); } } }