- 最后登录
- 2019-12-2
- 注册时间
- 2012-8-25
- 阅读权限
- 90
- 积分
- 34660
- 纳金币
- 38268
- 精华
- 111
|
iOS and Android
Networking for mobile devices (iOS / Android)
移动设备的网络操作(iOS/Android)
The Unity iOS/Android Networking engine is fully compatible with networking for desktop devices, so your existing networking code should work on iOS/Android devices. However, you may want to re-engineer your code if it is mainly to be used with Wi-Fi or cellular networks. Moreover, depending on the mobile, the networking chip may also be the bottleneck since pings between mobile devices (or between the mobile device and the desktop) are about 40-60 ms, even in high performance Wi-Fi networks.
Unity的iOS/Android网络操作引擎完全兼容桌面设备的网络操作,所以你的已经存在的网络操作代码可以工作在iOS/Android设备上。不过,如果其主要用于Wi-Fi或蜂窝网络你可能想要重新设计你的代码。再有,取决于移动的情况,在移动设备之间(或是在移动设备和桌面设备之间)ping值有大概40-60毫秒,即使是在高性能的Wi-Fi网络上,网络操作芯片也可能成为瓶颈。
Using Networking you can create a game that can be played simultaneously from desktop and iOS over Wi-Fi or cellular networks. In the latter case, your game server should have a public IP address (accessible through the internet).
使用网络操作你能够创建可以在桌面上和使用Wi-Fi或蜂窝网络的iOS上同时玩的游戏。在后面的情况下,你的服务器必须有公网IP地址(通过互联网访问)。
Note: EDGE / 3G data connections go to sleep very quickly when no data is sent. Thus sometimes you may need to "wake-up" networking. Just make the WWW class connect to your site (and yield until it finishes) before making the Unity networking connection..
注意:EDGE/3G数据连接在没有数据发送的时候会很快进入睡眠状态。因此有时候你可能需要"唤醒"网络操作。仅需要在让Unity网络操作连接之前使用WWW类连接到你的站点(并且切出[yield]直到它结束)。
|
|