Closed hugodigio closed 1 year ago
current bypass I check the WebXRManager.Instance.XRstate value change in the update() function of my script
As you mentioned, you disabled the WebXR prefab, where the WebXRManager
component is. As it doesn't run (and can't call the update loop), it can't invoke the event.
There's a CameraMain
game object that you can use for the "normal" mode instead of disabling the WebXR prefab.
Describe the bug I make a code that's listen OnXRChange event to handle some stuff in my scene (ex: disable WebXR Prefab when switch to "normal" mode to use the "normal" camera of my project previously implemented before adding WebXRmodule in it, enabling / disabling some specific behaviour for AR mode ... )
But when I test my code on my mobile device, when I switch to AR mode, the event seems to not been sent ! I've add some Debug.Log messages in my functions that listen this event and no ones are visible in chrome console when switching to AR mode.
I added some debug Button to my UI in Unity to make a Debug.log of the value WabXRManager.Instance.XRState in console, and the value is equal to XR, but no debug.log triggered by event.
To Reproduce Steps to reproduce the behavior:
create a script to handle WebXRManager.OnXRChange event
Expected behavior On Mobile Web browser, when switch to "AR" button is clicked, Web browser switch to AR mode and WebXRManager.OnXRChange will be triggered.
Unity info:
Smartphone :