当前位置:网站首页>【CocosCreator 3.5】CocosCreator 获取网络状态
【CocosCreator 3.5】CocosCreator 获取网络状态
2022-07-31 02:58:00 【CN-Dust】
Cocos自带有api获取网络状态
/**获取网络状态 */
public getNetwork() {
/** * 0: "NONE" * 1: "LAN" * 2: "WWAN" * LAN: 1 * NONE: 0 * WWAN: 2 */
return cc.sys.getNetworkType();
}
也可以打印cc.sys.NetworkType
查看这些值对应的含义。
边栏推荐
猜你喜欢
LeetCode简单题之找到和最大的长度为 K 的子序列
YOLOV5学习笔记(三)——网络模块详解
5. SAP ABAP OData 服务如何支持 $filter (过滤)操作
Face detection based on opencv
STM32CUBEMX develops GD32F303 (11) ---- ADC scans multiple channels in DMA mode
12 Disk related commands
Pythagorean tuple od js
Basic learning about Redis related content
SQL注入 Less46(order by后的注入+rand()布尔盲注)
LeetCode 1161 The largest element in the layer and the LeetCode road of [BFS binary tree] HERODING
随机推荐
【shell基础】判断目录是否为空
String为什么不可变?
接口测试关键技术
7、私信列表
Office automation case: how to automatically generate period data?
自动化办公案例:如何自动生成期数据?
Project (5) - Small target detection tph-yolov5
Discussion on Service Commitment of Class Objects under Multithreading
Draw Your Cards
【Bank Series Phase 1】People's Bank of China
The simulation application of common mode inductance is here, full of dry goods for everyone
【编译原理】词法分析程序设计原理与实现
字体压缩神器font-spider的使用
LeetCode简单题之找到和最大的长度为 K 的子序列
Live Preview | KDD2022 Doctoral Dissertation Award Champion and Runner-up Dialogue
How to build a private yum source
多线程下类对象的服务承诺探讨
Difference between CMOS and TTL?
Unity3D Button mouse hover enter and mouse hover exit button events
Chapter 9 SVM Practice