Hello,
I am trying this little piece of code in playground and I was expecting the debugger to hide after showing it:
scene.debugLayer.show({embedMode: true});
scene.debugLayer.hide();
What do I miss?
Hello,
I am trying this little piece of code in playground and I was expecting the debugger to hide after showing it:
scene.debugLayer.show({embedMode: true});
scene.debugLayer.hide();
What do I miss?
Maybe a problem with a browser. Which browser do you use?
Works at home with Google chome, Opera and Firefox
Actually, also in your example, if you comment hide -> run, then comment show and uncomment hide -> run. it doesn’t hide
This is interesting, hide only works with setTimeout. Even when I comment show, hide doesn’t work without setTimeout.
I don’t explain it either. But it works.
This is because we could face a race condition issue. The show is async and is not instantaneous. So if it takes longer than expected then hide will be executed BEFORE the layer is actually displayed
debugLayer.show
returns a promise. So if you wanted to do something to the inspector after showing it, you can add a continuation.