Esempio n. 1
0
 // Use this for initialization
 public void setup()
 {
     //udp = this.gameObject.GetComponent<UDP>();
     if (udp == null)
     {
         udp = this.gameObject.AddComponent <UDP>();
     }
     if (!udp.IsOpen())
     {
         udp.Setup();
         udp.SetupSender(ip, sendPort);
         udp.Create();
     }
 }
Esempio n. 2
0
    public void setup()
    {
        udp = this.gameObject.GetComponent <UDP>();
        if (udp == null)
        {
            udp = this.gameObject.AddComponent <UDP>();
        }
        if (!udp.IsOpen())
        {
            udp.Setup();
            udp.SetupReceiver(receivePort);
            //udp.SetReceiveDataHandler(OnReceiveData);
            //udp.SetReceivePacketHandler(OnReceivePacket);
            udp.SetReceiveDataQueueHandler(OnReceiveDataQueue);

            udp.Create();
        }
    }