Worlds functionality can also be accessed through the
PlayResolverjust like rooms. Worlds work a differently however and are a bit simpler.
First we need to fetch the available Worlds. Unlike Rooms, Worlds cannot be created by a Client and need to be setup in the Developer Portal.
async Task<(IReadOnlyList<WorldData>, bool)> FetchWorlds()
PlayResolver.csallows us to fetch the available Worlds for our project. This task returns a list of Worlds in the form of
WorldsDataobjects and a boolean that indicates if the operation was successful.
async Task<WorldData> FetchLocalWorld()
PlayResolver.csreturns the local World for a local running World Server.
WorldsConnectDialogpopulates a dropdown with the Worlds returned by both of these methods so we can select a World.
After we've selected a World we can connect to it using:
void JoinWorld(IClient client, WorldData data, bool isSimulator = false)
PlayResolver.csconnects the Client that we pass to the method to the World we pass to the method.
WorldsConnectDialogis an example implementation for Worlds usage.