Im using photon unity networking and i can’t figure out a good way of displaying all the games so you can choose one to join, currently you can search for a game and it will show up but what is the best way of spacing out the buttons because if two games have a similair name then they appear on top of each other, i don’t see how i could do it efficiently, here is my code so far:
using UnityEngine;
using System.Collections;
public class RoomMechanics : MonoBehaviour {
public string InputField;
void Start ()
{
foreach (RoomInfo room in PhotonNetwork.GetRoomList())
{
//Debug.Log(room);
}
}
void OnGUI()
{
InputField=GUI.TextField (new Rect((Screen.width/2)-125,Screen.height/100,250,25),InputField);
foreach( RoomInfo room in PhotonNetwork.GetRoomList())
{
if(InputField!="")
{
if(room.name.ToString().Contains(InputField))
{
if(GUI.Button (new Rect((Screen.width/2)-125,300,250,50),room.name))
{
}
}
}
}
}
}