// Start is called before the first frame update void Start() { _myIO = GetComponent <CCArtNetIO>(); _myIO.isServer = true; _myIO.ReceiveDMX += (object sender, CCArtNetDMXPaket dmx) => { Array.Reverse(dmx.data); Debug.Log(dmx.data.Length); currentMillis = BitConverter.ToInt32(dmx.data, dmx.data.Length - 4); _myIsUpdated = true; }; }
public void CreateDevices(string theIp, int theStart, int theDevices) { CCArtNetIO[] myIOS = GetComponents <CCArtNetIO>(); int maxDevice = 0; foreach (CCArtNetIO myIO in myIOS) { maxDevice = System.Math.Max(maxDevice, myIO.deviceID); } artnetIOs = new CCArtNetIO[theDevices]; for (int i = 0; i < theDevices; i++) { CCArtNetIO myIO = gameObject.AddComponent <CCArtNetIO>(); myIO.deviceID = i; myIO.remoteIP = theIp + (theStart + i); artnetIOs[i] = myIO; } }