Adds empty implementation of cc.Device.getBatteryLevel/getNetworkType for web.

This commit is contained in:
James Chen
2018-01-17 13:36:55 +08:00
parent ff97584159
commit 3afa2c76eb
3 changed files with 20 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
var cc = cc || {};
cc.NetworkType = {
NONE: 0,
LAN: 1,
WWAN: 2
};
cc.Device = {
getBatteryLevel: function() {
// TODO: need to implement this for mobile phones.
return 1.0;
},
getNetworkType: function() {
// TODO: need to implement this for mobile phones.
return cc.NetworkType.LAN;
}
};
+1
View File
@@ -35,6 +35,7 @@ require('./instantiate');
require('./instantiate-jit');
require('./requiring-frame');
require('./CCSys');
require('./CCDevice');
require('./CCMacro');
if (!(CC_EDITOR && Editor.isMainProcess)) {
+1
View File
@@ -52,6 +52,7 @@ var jsbSkipModules = [
'../../cocos2d/core/physics/platform/CCPhysicsContactListner.js',
'../../cocos2d/core/physics/platform/CCPhysicsAABBQueryCallback.js',
'../../cocos2d/core/physics/platform/CCPhysicsRayCastCallback.js',
'../../cocos2d/core/platform/CCDevice.js',
'../../cocos2d/core/platform/CCInputManager.js',
'../../cocos2d/core/platform/CCVisibleRect.js',
'../../cocos2d/core/camera/CCSGCameraNode.js',