mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-06-30 07:24:26 +08:00
.
This commit is contained in:
@@ -8,7 +8,7 @@ import { __private, native, sys } from "cc";
|
||||
/** 平台数据 */
|
||||
export class PlatformUtil {
|
||||
/** 获取当前设备的网络类型, 如果网络类型无法获取,默认将返回 `sys.NetworkType.LAN` */
|
||||
getNetworkType(): __private._pal_system_info_enum_type_network_type__NetworkType {
|
||||
static getNetworkType(): __private._pal_system_info_enum_type_network_type__NetworkType {
|
||||
return sys.getNetworkType();
|
||||
}
|
||||
|
||||
@@ -16,17 +16,17 @@ export class PlatformUtil {
|
||||
* 获取当前设备的电池电量,如果电量无法获取,默认将返回 1
|
||||
* @return - 0.0 ~ 1.0
|
||||
*/
|
||||
getBatteryLevel(): number {
|
||||
static getBatteryLevel(): number {
|
||||
return sys.getBatteryLevel();
|
||||
}
|
||||
|
||||
/** 尝试打开一个 web 页面,并非在所有平台都有效 */
|
||||
openURL(url: string) {
|
||||
static openURL(url: string) {
|
||||
sys.openURL(url);
|
||||
}
|
||||
|
||||
/** 拷贝字符串到剪切板 */
|
||||
copyText(text: string) {
|
||||
static copyText(text: string) {
|
||||
native.copyTextToClipboard(text);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user