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

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using Multiplayer;
  6. using TMPro;
  7. public class HomeScreenManager : MonoBehaviour {
  8. public TextMeshProUGUI IP;
  9. public TextMeshProUGUI Port;
  10. public TextMeshProUGUI Name;
  11. public void Connect()
  12. {
  13. int intVal = 0;
  14. bool Succeeded = int.TryParse(Port.text, out intVal);
  15. if (Succeeded)
  16. {
  17. Destroy(ServerManager.Instance.gameObject);
  18. ClientManager.Instance.StartClient(IP.text, intVal);
  19. }
  20. }
  21. public void Host()
  22. {
  23. int intVal = 0;
  24. bool Succeeded = int.TryParse(Port.text, out intVal);
  25. if (Succeeded)
  26. {
  27. ServerManager.Instance.StartServer();
  28. }
  29. }
  30. }