void LateUpdate() { if (!VRSetup) { return; } DoUglyCameraHack(); if (VRInput.GetActionDown(InputAction.Aim)) { if (watch) { watch.SwitchState(); } //UIVisible = !UIVisible; //VRGlobal.ClearUIRenderTex(); //PlayerGui.SetVisible(UIVisible); //PlayerGui.Inventory.SetVisible(UIVisible); // PlayerGui.m_playerStatus.SetVisible(UIVisible); //PlayerGui.m_compass.SetVisible(UIVisible); } UpdateOrigin(); }
void Update() { if (overlayHandle != OpenVR.k_ulOverlayHandleInvalid) { var texture = new Texture_t(); texture.handle = UI_ref.m_UIRenderTarget.GetNativeTexturePtr(); texture.eType = SteamVR.instance.textureType; texture.eColorSpace = EColorSpace.Auto; OpenVR.Overlay.SetOverlayTexture(overlayHandle, ref texture); if (VRInput.GetActionDown(InputAction.Crouch)) { OrientateOverlay(); } } }