creator 1.8.1 在计时器中切换场景报错

bad_swizer
Wed, 07 Mar 2018 06:53:30 +0000

在计时器中切换场景报错
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’)
},

阅读整个主题