在计时器中切换场景报错
Cannot read property ‘height’ of null;at setTimeout callback function
TypeError: Cannot read property ‘height’ of null
构建成小游戏 会报这个错
代码
this.scheduleOnce(function () {
var time = Global.aniTime / 1000
this.scheduleOnce(function () {
cc.director.loadScene(‘Over’)
}, time + .3)
}, 30)
toOver () {
cc.director.loadScene(‘Over’)
},