How to create a server list and "join" buttons with the new UI system?

Hello, I want to use the Unet Matchmaker but the GUI is in the old system, how can I make it with the new UI?.
NetworkmanagerHUD.cs https://bitbucket.org/Unity-Technologies/networking/src/2bdd9961092c4a73443c09694cff5dde9e56f9f1/Runtime/NetworkManagerHUD.cs?at=5.4&fileviewer=file-view-default

Extract:

void OnGUI()
        {
            int xpos = 10 + offsetX;
            int ypos = 40 + offsetY;
            const int spacing = 24;    

         
                            for (int i = 0; i < manager.matches.Count; i++)
                            {
                                var match = manager.matches[i];
                                if (GUI.Button(new Rect(xpos, ypos, 200, 20), "Join Match:" + match.name))
                                {
                                    manager.matchName = match.name;
                                    manager.matchMaker.JoinMatch(match.networkId, "", "", "", 0, 0, manager.OnMatchJoined);
                                }
                                ypos += spacing;
                            }

                            if (GUI.Button(new Rect(xpos, ypos, 200, 20), "Back to Match Menu"))
                            {
                                manager.matches = null;
                            }
                            ypos += spacing;
                        }
}

I was searching but with not luck.

Thanks in advance.

You should probably start from here: Learn game development w/ Unity | Courses & tutorials in game design, VR, AR, & Real-time 3D | Unity Learn

1 Like

Hello, I just found some info about making a fixed UI and setactive true/false when there is servers. Only can show 5 servers on screen but for the moment it is valid.
But the optimal code will be creating a list in real time and make a scroll when it don´t fit on the screen, and your link seems that have the info I need.

Thanks you very much.