cc.game.on(cc.game.EVENT_GAME_INITED, function () {
utils.getLocation();
});
会报错,找不到“utils”。
找到引擎对应的
on: function(type, callback, target) {
this._prepared && type === this.EVENT_ENGINE_INITED || !this._pause && type === this.EVENT_GAME_INITED ? callback.call(target) : this.eventTargetOn(type, callback, target);
}
发现this._pause未定义,修改为this._paused后,正常。