Detecting that you are really on BabylonNative

I am rewriting / formalizing the code which glues all of my exports into a cohesive module for what I am working on into typescript. I am exclusively running on browser right now, but I already know there are things that I want differently when running on BabylonNative.

Currently it is just a constant, but is there a test which can be done?

Adding @Cedric and @syntheticmagus :slight_smile:

There is no function to tell you explicitly you are running on BN. But, you can deduce it even though it’s subject to change in the future.
With BN, document is an empty object.
Maybe you can test if document.body exists. If it doesn’t then that’s BabylonNative.

1 Like

Yes, I assumed it has to be a “negative” test, as it needs to function on a browser. Thanks.