Renan Viewport Posted April 5, 2024 Posted April 5, 2024 On 8/23/2023 at 4:10 PM, VIVE_chengnay said: To clarify your question, You get the event(status of proximity sensor) and do Application.Quit(). I assume you will get status from proximity sensor right after you took off the HMD? You mentioned three more mins(should be the same as I mentioned above that OnApplicationPause will take 3 mins to trigger after HMD off). May I know the LBE settings, what is this about? Is this settings in Vive headset? Hi I tried to use Common.userPresence and tried to use the SystemEvent, and could not get the information of when the user removes the headset, I'm using a FOcus 3 but I can do a test on a XR Elite as well: void Start() { Wave.Essence.Events.SystemEvent.Listen(WVR_EventType.WVR_EventType_DeviceResume, OnEventResume1); Wave.Essence.Events.SystemEvent.Listen(WVR_EventType.WVR_EventType_DeviceSuspend, OnEventResume2); Wave.Essence.Events.SystemEvent.Listen(WVR_EventType.WVR_EventType_DeviceInfoUpdate, OnEventResume3); Wave.Essence.Events.SystemEvent.Listen(WVR_EventType.WVR_EventType_RenderingToBePaused, OnEventResume4); Wave.Essence.Events.SystemEvent.Listen(WVR_EventType.WVR_EventType_RenderingToBeResumed, OnEventResume5); } private void OnEventResume1(WVR_Event_t systemEvent) { Debug.LogError("--------------- CALLED EVENT 1"); } private void OnEventResume2(WVR_Event_t systemEvent) { Debug.LogError("--------------- CALLED EVENT 2"); } private void OnEventResume3(WVR_Event_t systemEvent) { Debug.LogError("--------------- CALLED EVENT 3"); } private void OnEventResume4(WVR_Event_t systemEvent) { Debug.LogError("--------------- CALLED EVENT 4"); } private void OnEventResume5(WVR_Event_t systemEvent) { Debug.LogError("--------------- CALLED EVENT 5"); }
VIVE_chengnay Posted April 8, 2024 Posted April 8, 2024 Hi @Renan Viewport, Not sure if below solution OK for you, It required to install Unity Input System plugin. bool IsUserPresence() { if (ProximitySensor.current != null) { if (!ProximitySensor.current.IsActuated()) InputSystem.EnableDevice(ProximitySensor.current); return ProximitySensor.current.distance.ReadValue() < 1; } return false; } On 8/23/2023 at 4:25 PM, JulienActiveMe said: 3 minutes is a lot, is there a way I can put the HMD to sleep from script? Hi @JulienActiveMe, I forgot to reply your question. Sorry about that and please try the solution.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now