Unity Web Player无法通过在Mac上重新加载来加载图片

Unity web player can't load picture by reloading on Mac
2021-03-07
  •  译文(汉语)
  •  原文(英语)

我想通过使用Unity Web Player创建Web应用程序.应用程序通过使用webSocket-sharp与服务器通信,并从服务器加载标题的背景图片.

我即将完成该应用程序,但是,当我重新加载该应用程序时,它失败了,没有显示图片.这种现象仅是Mac(我尝试过野生动物园,Chrome浏览器).在Windows上没有发生.

据我搜索,"关闭"函数(webSocket-sharp函数)后立即调用"关闭"函数(webSocket-sharp函数).

我不能解决问题,你能告诉我原因吗?

谢谢.

速聊1:
你可以发布一些代码吗?
解决过程1

我也遇到了同样的问题.当重新加载或关闭chrome / firefox / safari并再次打开它们以重新加载网络播放器时,网络播放器在首次使用套接字时应关闭连接.我抛弃了chrome助手EH(我认为这个人管理着webplayer插件),似乎单声道正在等待某些信号量.如果Chrome助手EH被强制退出,则Webplayer再次变得可用,套接字可以工作.这种情况永远不会在Windows或Linux中发生.这可能是Mac中的网络播放器插件问题.我试图找出单声道正在等待的信号量.如果我可以在代码中释放信号量,则该问题可以解决.现在,我尝试在unity3D中添加一些代码.1)清除所有插座连接.2)将所有与套接字相关的变量设置为null.3)手动调用GC.不幸的是,问题仍然存在.

I would like to create web application by using Unity web player. The application is communicate to server by using webSocket-sharp,and background picture of title is loaded from server.

I'm about complete the application, however, when I reload the application, it failed, the picture isn't showed. The phenomenon is only Mac(I tried safari, chrome). It didn't occur on Windows.

As far as I searched, "close" function(webSocket-sharp function) is immediately called after "open" function(webSocket-sharp function).

I can't solve the problem, could you tell me the reason?

thank you.

Talk1:
can you post some code?
Solutions1

I also met same problem. When reload or close the chrome/firefox/safari then open them again to reload the webplayer, the webplayer shall close the connection when it firstly uses the socket. I dump the chrome Helper EH(I think this guy manages webplayer plugin), it seems that the mono is waiting for some semaphore. If the chrome Helper EH is forced to quit, the webplayer becomes available again, the socket works. The case never gonna happen in Windows or Linux. It could be a webplayer plugin issue in mac. I try to figure out what is the semaphore the mono waiting for. If I can release the semaphore in code, the issue could be fixed. Util now, I tried add some code in unity3D. 1) Clear all socket connection. 2) Set all socket related variant to null. 3) manually call GC. Unfortunately, the issue is still here.

转载于:https://stackoverflow.com/questions/23054313/unity-web-player-cant-load-picture-by-reloading-on-mac

本人是.net程序员,因为英语不行,使用工具翻译,希望对有需要的人有所帮助
如果本文质量不好,还请谅解,毕竟这些操作还是比较费时的,英语较好的可以看原文

留言回复
我们只提供高质量资源,素材,源码,坚持 下了就能用 原则,让客户花了钱觉得值
上班时间 : 周一至周五9:00-17:30 期待您的加入