Create JoinGameWindow

This commit is contained in:
in0finite 2019-04-23 20:58:43 +02:00
parent 503bf098c1
commit f15a35f15e
2 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,55 @@
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()
{
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 31b84c3125e1d2c8dbb3fb60c30cfe41
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: