mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-26 05:50:18 +00:00
Create JoinGameWindow
This commit is contained in:
parent
503bf098c1
commit
f15a35f15e
2 changed files with 66 additions and 0 deletions
55
Assets/Scripts/UI/JoinGameWindow.cs
Normal file
55
Assets/Scripts/UI/JoinGameWindow.cs
Normal 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()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
11
Assets/Scripts/UI/JoinGameWindow.cs.meta
Normal file
11
Assets/Scripts/UI/JoinGameWindow.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 31b84c3125e1d2c8dbb3fb60c30cfe41
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in a new issue