mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 18:42:40 +08:00
fix _unregisterAccelerometerEvent err (#2918)
This commit is contained in:
@@ -32,6 +32,8 @@ var inputManager = require("./CCInputManager");
|
||||
|
||||
inputManager.__instanceId = cc.ClassManager.getNewInstanceId();
|
||||
|
||||
var _didAccelerateFun;
|
||||
|
||||
/**
|
||||
* whether enable accelerometer event
|
||||
* @method setAccelerometerEnabled
|
||||
@@ -92,7 +94,8 @@ inputManager._registerAccelerometerEvent = function(){
|
||||
_t._minus = -1;
|
||||
}
|
||||
|
||||
w.addEventListener(_deviceEventType, _t.didAccelerate.bind(_t), false);
|
||||
_didAccelerateFun = _t.didAccelerate.bind(_t);
|
||||
w.addEventListener(_deviceEventType, _didAccelerateFun, false);
|
||||
};
|
||||
|
||||
inputManager._unregisterAccelerometerEvent = function () {
|
||||
|
||||
@@ -610,6 +610,5 @@ js.get(cc, 'inputManager', function () {
|
||||
cc.warnID(1405, 'cc.inputManager', 'cc.systemEvent');
|
||||
return inputManager;
|
||||
});
|
||||
_cc.inputManager = inputManager;
|
||||
|
||||
module.exports = inputManager;
|
||||
module.exports = _cc.inputManager = inputManager;
|
||||
|
||||
Reference in New Issue
Block a user