Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

适配微信小程序 #11

Open
DabbyCHEN opened this issue Dec 19, 2024 · 1 comment
Open

适配微信小程序 #11

DabbyCHEN opened this issue Dec 19, 2024 · 1 comment

Comments

@DabbyCHEN
Copy link

我使用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,请问能不能更新或者说明一下。
万分感谢~

@iohao
Copy link
Owner

iohao commented Dec 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants