wlyx123 Posted July 6, 2023 Share Posted July 6, 2023 I need to receive UDP data and create nodes dynamically. public override bool Init() { UDPClient = new UDP(); UDPClient.OnReciveDate += InitModel; task = Task.Run(() => { UDPClient.Recive(); }); return true; } private void InitModel(byte[] buf) { try { var res = Util.BytesToStruct(buf); NodeReference node = new NodeReference("capsule.Node"); n.Name = res.Id; } catch (Exception ex) { Log.ErrorLine(ex.Message); Log.ErrorLine(ex.StackTrace); } } Link to comment
wlyx123 Posted July 6, 2023 Author Share Posted July 6, 2023 (edited) And I try to use AsyncQueue. But I can't use it.Nodes create by AsyncQueue cant't show in the world. Edited July 6, 2023 by wlyx123 Link to comment
silent Posted July 6, 2023 Share Posted July 6, 2023 wlyx123 Node-related interactions are not thread-safe: https://developer.unigine.com/en/docs/2.17/code/fundamentals/thread_safety/?rlang=cs How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts