コード例 #1
0
        private UDPClient m_UDPClient02;             //UDP网络实例


        private void Start()
        {
            m_NetworkComponent = GameBox.GetComponent <NetworkComponent>();
            m_UDPServer        = m_NetworkComponent.CreateNetwork <UDPServer>("服务端", "127.0.0.1", 6666);
            m_UDPClient01      = m_NetworkComponent.CreateNetwork <UDPClient>("客户端01", "127.0.0.1", 6666);
            m_UDPClient02      = m_NetworkComponent.CreateNetwork <UDPClient>("客户端02", "127.0.0.1", 6666);

            m_NetworkComponent.NetworkEventHandler += M_NetworkComponent_NetworkEventHandler; //监听网络事件
            m_NetworkComponent.Register(this);
        }