ioGameExamples icon indicating copy to clipboard operation
ioGameExamples copied to clipboard

适配微信小程序

Open DabbyCHEN opened this issue 1 year ago • 1 comments

我使用Demo,可以在Unity环境中连接上WebSocket,并收到消息。 但是当用Untiy打包成微信小程序时,它没有反应,不会Open、Error、Close。 我查询微信官方文档:https://wechat-miniprogram.github.io/minigame-unity-webgl-transform/Design/UsingNetworking.html 它表示:由于安全性的影响,JavaScript 代码没有直接访问 IP 套接字来实现网络连接。因此,该.NET 网络类(System.Net 命名空间中的一切,特别是System.Net.Sockets)在 WebGL 中不能工作。UnityEngine.Network* 类也是这样,编译 WebGL 时将找不到这些类。 我使用https://github.com/psygames/UnityWebSocket是可以在Unity和微信小程序中连接的。 我看到您之前有个项目:https://github.com/iohao/iogame-unity底层是用的UnityWebSocket,但是Demo里没有写明怎么调用Action,请问能不能更新或者说明一下。 万分感谢~

DabbyCHEN avatar Dec 19 '24 03:12 DabbyCHEN

sdk 相关 issues 请转移到 https://github.com/iohao/ioGame/issues

iohao avatar Dec 19 '24 05:12 iohao