示例#1
0
    void Update()
    {
        if (Time.time - curTime > 10)
        {
            client.SendMessageToAll(Encoding.UTF8.GetBytes("Hi there I'm a client"), true);
            curTime = Time.time;
        }

        client.UpdateClient();
    }
示例#2
0
 private void Update()
 {
     isRecording = Input.GetKey(KeyCode.P);
     client.UpdateClient();
     if (client.peers.Count > 0)
     {
         while (packets.Count > 0)
         {
             float[] curPacket = packets.Dequeue();
             ToShortArray(curPacket, outBufferShort);
             int resLen = speexEnc.Encode(outBufferShort, 0, curPacket.Length, outBuffer, 0, outBuffer.Length);
             client.SendMessageToAll(outBuffer, 0, resLen, true);
         }
     }
 }
示例#3
0
 void FixedUpdate()
 {
     recorder.Poll();
     client.UpdateClient();
 }