示例#1
0
    public void HostButton()
    {
        try
        {
            ChatServer s = Instantiate(server).GetComponent <ChatServer>();
            s.Init();

            ChatClient c = Instantiate(client).GetComponent <ChatClient>();
            c.ConnectToServer("127.0.0.1", 6321);
        }
        catch (Exception e)
        {
            Debug.Log(e.Message);
            throw;
        }
    }