How to accès the Scene Manager outside of scenes?

Hi Everyone!

Could anyone recommend what the best practise is for access the scene manager outside of scenes?
Usually I would access the scene manager like this, from within a scene:

this.scene

But, I have a separate, UI built in HTML, that also needs to access it. I understand that game.scene is deprecated (javascript - Phaser 3: Starting a scene (stopping all other running scenes) from the global "game" object - Stack Overflow)

What the best way is to access provide global access to the scene manager to other, non-Phaser, parts of a codebase?

Thanks!

You can still use game.scene for that. And maybe queueOp() if timing is a problem.

Thanks @samme!

My understanding from that StackOverflow link is that using game.scene is risky for things like game.scene.start as is disregards the game step, and I’m wary of introducing bugs.

So far our workaround for this is having a root BootScene that displays nothing but just hangs around for the entire game so that we have always an instantiated scene that we can reference the SceneManager on for global tasks we need to perform in our HTML UI code. It does feel like a hack though.