SanAndreasUnity/Assets/Scripts/UI/JoinGameWindow.cs

56 lines
987 B
C#
Raw Normal View History

2019-04-23 18:58:43 +00:00
using System.Collections.Generic;
using UnityEngine;
using SanAndreasUnity.Utilities;
using SanAndreasUnity.Net;
namespace SanAndreasUnity.UI
{
public class JoinGameWindow : PauseMenuWindow
{
string m_ip = "";
string m_port = NetManager.defaultListenPortNumber.ToString();
JoinGameWindow()
{
// set default parameters
this.windowName = "Join Game";
this.useScrollView = true;
}
void Start ()
{
// adjust rect
this.windowRect = GUIUtils.GetCenteredRect(new Vector2(550, 300));
}
protected override void OnWindowGUI ()
{
GUILayout.Label ("IP:");
m_ip = GUILayout.TextField(m_ip);
GUILayout.Label ("Port:");
m_port = GUILayout.TextField(m_port);
GUILayout.Space(40);
if (GUILayout.Button("Connect", GUILayout.MinWidth(80), GUILayout.MinHeight(30)))
Connect();
}
void Connect()
{
}
}
}