|
|
- 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();
- }
- }
- }
|