// 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(); } }
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(); } }