private void ShowControls()
{
this.m_ShowControls = EditorGUILayout.Foldout(this.m_ShowControls, this.m_ShowControlsLabel);
if (this.m_ShowControls)
{
if (!string.IsNullOrEmpty(NetworkManager.networkSceneName))
{
EditorGUILayout.ObjectField("Current Scene:", GetSceneObject(NetworkManager.networkSceneName), typeof(UnityEngine.Object), true, new GUILayoutOption[0]);
}
EditorGUILayout.Separator();
if ((!NetworkClient.active && !NetworkServer.active) && (this.m_Manager.matchMaker == null))
{
EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
if (GUILayout.Toggle(false, "LAN Host", EditorStyles.miniButton, new GUILayoutOption[0]))
{
this.m_Manager.StartHost();
}
if (GUILayout.Toggle(false, "LAN Server", EditorStyles.miniButton, new GUILayoutOption[0]))
{
this.m_Manager.StartServer();
}
if (GUILayout.Toggle(false, "LAN Client", EditorStyles.miniButton, new GUILayoutOption[0]))
{
this.m_Manager.StartClient();
}
if (GUILayout.Toggle(false, "Start Matchmaker", EditorStyles.miniButton, new GUILayoutOption[0]))
{
this.m_Manager.StartMatchMaker();
this.m_ShowMatchMaker = true;
}
EditorGUILayout.EndHorizontal();
}
if ((NetworkClient.active && !ClientScene.ready) && GUI.Button(GetButtonRect(), "Client Ready"))
{
ClientScene.Ready(this.m_Manager.client.connection);
if (ClientScene.localPlayers.Count == 0)
{
ClientScene.AddPlayer(0);
}
}
if ((NetworkServer.active || NetworkClient.active) && GUI.Button(GetButtonRect(), "Stop"))
{
this.m_Manager.StopServer();
this.m_Manager.StopClient();
}
if (!NetworkServer.active && !NetworkClient.active)
{
EditorGUILayout.Separator();
if ((this.m_Manager.matchMaker != null) && (this.m_Manager.matchInfo == null))
{
if (this.m_Manager.matches == null)
{
EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
if (GUILayout.Toggle(false, "Create Internet Match", EditorStyles.miniButton, new GUILayoutOption[0]))
{
this.m_Manager.matchMaker.CreateMatch(this.m_Manager.matchName, this.m_Manager.matchSize, true, "", "", "", 0, 0, new NetworkMatch.DataResponseDelegate<MatchInfo>(this.m_Manager.OnMatchCreate));
}
if (GUILayout.Toggle(false, "Find Internet Match", EditorStyles.miniButton, new GUILayoutOption[0]))
{
this.m_Manager.matchMaker.ListMatches(0, 20, "", false, 0, 0, new NetworkMatch.DataResponseDelegate<List<MatchInfoSnapshot>>(this.m_Manager.OnMatchList));
}
if (GUILayout.Toggle(false, "Stop MatchMaker", EditorStyles.miniButton, new GUILayoutOption[0]))
{
this.m_Manager.StopMatchMaker();
}
EditorGUILayout.EndHorizontal();
this.m_Manager.matchName = EditorGUILayout.TextField("Room Name:", this.m_Manager.matchName, new GUILayoutOption[0]);
this.m_Manager.matchSize = (uint) EditorGUILayout.IntField("Room Size:", (int) this.m_Manager.matchSize, new GUILayoutOption[0]);
EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
if (GUILayout.Toggle(false, "Use Local Relay", EditorStyles.miniButton, new GUILayoutOption[0]))
{
this.m_Manager.SetMatchHost("localhost", 0x539, false);
}
if (GUILayout.Toggle(false, "Use Internet Relay", EditorStyles.miniButton, new GUILayoutOption[0]))
{
this.m_Manager.SetMatchHost("mm.unet.unity3d.com", 0x1bb, true);
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.Separator();
}
else
{
foreach (MatchInfoSnapshot snapshot in this.m_Manager.matches)
{
if (GUI.Button(GetButtonRect(), "Join Match:" + snapshot.name))
{
this.m_Manager.matchName = snapshot.name;
this.m_Manager.matchSize = (uint) snapshot.currentSize;
this.m_Manager.matchMaker.JoinMatch(snapshot.networkId, "", "", "", 0, 0, new NetworkMatch.DataResponseDelegate<MatchInfo>(this.m_Manager.OnMatchJoined));
}
}
if (GUI.Button(GetButtonRect(), "Stop MatchMaker"))
{
this.m_Manager.StopMatchMaker();
}
}
}
}
EditorGUILayout.Separator();
}
}