Пример #1
0
        private void OnGUI()
        {
            if (GUILayout.Button("start sever", GUILayout.Width(400), GUILayout.Height(200)))
            {
                host = new ServerHost();

                host.Begin();
            }

            if (GUILayout.Button("Client A Connect", GUILayout.Width(400), GUILayout.Height(200)))
            {
                NetChannel client = new NetChannel("Client A");
                clients["Client A"] = client;
                client.Connect("127.0.0.1", 4567);
            }

            if (GUILayout.Button("Client A Send", GUILayout.Width(400), GUILayout.Height(200)))
            {
                clients["Client A"].Send("hello world");
                Loger.Color("Client A" + "say-->hello world", "yellow");
            }
        }