unity客户端自动断开连接

时间:2018-02-15 18:28:59   收藏:0   阅读:1309

问题描述:

当unity失去焦点一段时间后,与photon服务器端断开连接

问题根源:

默认unity失去焦点后会暂停运行,导致连接超时,服务器端超时断开连接

解决方案:

连接服务器后,填加一句代码让unity在失去焦点的情况下继续执行游戏

Application.runInBackground = true;

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!