// Start is called before the first frame update public void Start() { Instance = this; DontDestroyOnLoad(gameObject); connectMenu.SetActive(false); Host(() => { try { Server s = Instantiate(ServerPrefab).GetComponent <Server>(); s.Init(); ClientTCP c = Instantiate(ClientTCPPrefab).GetComponent <ClientTCP>(); } catch (Exception e) { Debug.Log(e.Message); } }); Back(() => { Global.WinnerInt = -1; SceneManager.LoadScene("MultiplayerScene"); }); Connect(() => { string hostAddress = GameObject.Find("HostInput").GetComponent <TMP_InputField>().text; if (hostAddress == "") { hostAddress = "127.0.0.1"; } try { ClientTCP c = Instantiate(ClientTCPPrefab).GetComponent <ClientTCP>(); c.Connect(); Debug.Log("by connect button"); } catch (Exception e) { Debug.Log(e.Message); } }); }
void Start() { clientTCP.Connect(); }
public void Test_async_connect() { Debug.Log("Attempting to connect -- listening for server reply .. "); clientConnection.Connect( ); clientConnection.ListenAndRecvAsync( ); }
public void Connect() { clientTCP.Connect(); }