Sys-level system

Open the address link to other sites:
cc.sys.openURL ( ' http://www.jianshu.com' );

Jump page:
cc.director.loadScene ( "the Login");

cc.sys.isNative (Boolean)
whether the local platform

cc.sys.isBrowser (Boolean)
Indicates whether the system is a web browser

cc.sys.isMobile (Boolean)
indicates whether the system is a mobile system

cc.sys.platform (Number)
indicating operating platform

cc.sys.language (String)
indicate the operating system's current language

cc.sys.os (String)
indicates the running os name

cc.sys.browserType (String)
indicating a running browser type

cc.sys.browserVersion (Number)
indicates the running browser version

cc.sys.windowPixelResolution (Number)
indicates the real pixel resolution throughout the game window

cc.sys.localStorage (Object)
local storage assembly, similar to Andrews lightweight storage. Storage, carrying, use the delete method:

cc.sys.localStorage.setItem("bgmVolume",v); var t = cc.sys.localStorage.getItem("bgmVolume"); cc.sys.localStorage.removeItem("wx_account"); 

cc.sys.capabilities (Object)
current platform functionality

example:

if (cc.sys.isNative) {
    cc.log("本地平台");
    if (cc.sys.isMobile) {
        cc.log("本地移动平台");
        if (cc.sys.os == cc.sys.OS_ANDROID) {
            cc.log("本地Android平台");
        } else if (cc.sys.os == cc.sys.OS_IOS) {
            cc.log("本地ios平台");
        }
     } else {
         cc.log("Web平台");
     }
}


Source: https: //www.jianshu.com/p/6d9dec58352a

Guess you like

Origin www.cnblogs.com/gao88/p/11520455.html