Scene UI Manager
It's common for some games to have many different Scene UIs loaded into a game at the same time. This can become difficult to track or manage manually, especially if you need to retrieve and perform updates on specific Scene UI instances.
For this, we have the SceneUIManager that provides ways to quickly retrieve, iterate and update loaded Scene UIs in a world.
Accessing A SceneUIManager
The SceneUIManager is used as a singleton and automatically created for a given world instance.
You can access the Scene UI Manager for a world like this:
world.sceneUIManager
Using A SceneUIManager
The SceneUIManager exposes a number of ways to get different types of SceneUI instances loaded in a world. Here's a few examples of how you can use it.
// Returns an array of all loaded scene ui
// instances for the world
world.sceneUIManager.getAllSceneUIs();
// Returns an array of all loaded scene ui
// instances attached to the provided entity.
world.sceneUIManager.getAllEntityAttachedSceneUIs(someEntity);
Diving Deeper
The SceneUIManager class is constantly evolving. You can find the latest SceneUIManager API Reference here.
If there are features that we don't currently support for SceneUIManager that you'd like to see added to the HYTOPIA SDK, you can submit a feature request here.
Last updated