在A脚本关闭写在B脚本的键盘监听,为什么没作用?求解呀

--------------------A脚本
gameOver: function () {
var Global = require(“Player”);
Global.randColor
},
----------------------B脚本
var cfg={
backLabel: 10,
randColor:function(){
cc.systemEvent.off(cc.SystemEvent.EventType.KEY_DOWN, this.onKeyDownaaa, this);
cc.systemEvent.off(cc.SystemEvent.EventType.KEY_UP, this.onKeyUp, this);
}
}
module.exports = cfg

onLoad () {
// 初始化键盘输入监听
cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN, this.onKeyDownaaa, this);
cc.systemEvent.on(cc.SystemEvent.EventType.KEY_UP, this.onKeyUp, this);
},

Global.randColor() ?

因为Player脚本并不是单例,你通过require(“Player”)得到的不是之前的对象。