Perhaps I don't understand! Help with switching screens

I’m new to Unity so apologies if I should know this… however I am designing a game that will have quite a few options and menus for the user to interact with. I have a few questions:

  1. What is the official entry point to the app? Is it the GameObject? Or something else?
    If it is the GameObject, how do I invoke the first UIDocument (MainMenu.uxml)?

  2. Once the user is interacting with the UIDocument, how do I move to another document? I assume 1 UIDocument is one screen. So for example, How do I move from the MainMenu.uxml to “PlayerSetup.uxml”

So far I have managed to design the two different documents and now I would like to start hooking it all together

Thanks!

In your project, once Unity’s stuff is out of the way, is the first scene in your build list, and any game object/code that runs after that point.

Some things can be run earlier using [RuntimeInitializeOnLoadMethod] though most things should be let for the first initial scene.

UI Toolkit UI’s are drawn via the UIDocument component. If you have one in a loaded scene, the UI draws. So if you want a UI to show, just set up said component in a scene and reference your visual tree asset.

If you want to show/hide UI documents, I often make prefabs out of these game objects and just destroy/instantiate them. But you can also just disable the root visual element of a visual tree to hide it as well. Just depends on use-case.

I will say the floor to learning to UI Toolkit is quite high. It might be worthwhile to try uGUI for the moment as that’s more inline with the usual Unity workflow, and move to UI Toolkit when you have the basics of Unity nailed down.