//初始化 void Initial() { msgList = new List <UDPMSG>(); udpSocket = new UdpSocket(); if (!CheckConfig()) { Debug.LogError("XML文件中通信设置读取错误!UDP模块初始化失败"); return; } if (udpSocket.BindSocket((ushort)udp_Port_Receive, bufferLength, DataReceive)) { Debug.Log("UDP模块初始化成功。"); StartCoroutine(SendUdpLoop()); } }