12345678910111213141516171819202122232425262728293031323334353637 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Net;
- using UnityEngine;
- using UnityEngine.UI;
-
- public class UIManager : MonoBehaviour
- {
- public static UIManager instance;
-
- public GameObject startMenu;
- public InputField usernameField;
- public InputField ipField;
-
- private void Awake()
- {
- if (instance == null)
- {
- instance = this;
- }
- else if (instance != this)
- {
- Debug.Log("Instance already exists. Destroying object !");
- Destroy(this);
- }
- }
-
- public void ConnectToServer()
- {
- startMenu.SetActive(false);
- usernameField.interactable = false;
- ipField.interactable = false;
-
- Client.instance.ip = ipField.text;
- Client.instance.ConnectToServer();
- }
- }
|