You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
795 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Multiplayer;
using TMPro;
public class HomeScreenManager : MonoBehaviour {
public TextMeshProUGUI IP;
public TextMeshProUGUI Port;
public TextMeshProUGUI Name;
public void Connect()
{
int intVal = 0;
bool Succeeded = int.TryParse(Port.text, out intVal);
if (Succeeded)
{
Destroy(ServerManager.Instance.gameObject);
ClientManager.Instance.StartClient(IP.text, intVal);
}
}
public void Host()
{
int intVal = 0;
bool Succeeded = int.TryParse(Port.text, out intVal);
if (Succeeded)
{
ServerManager.Instance.StartServer();
}
}
}