private void HeartBeat() { while (tcpServer.isRunning) { Loom.WaitForSeconds(beatTime); if (tcpServer != null) { Loom.DispatchToMainThread(() => { //NGUIDebug.Log(Command.HEART_BEAT); tcpServer.HeartBeat(); }, true); } } }