typescript脚本变量的值在方法中被改变后,在onLoad生命周期的绑定的事件回调中,获取的值还是改变前的

cocos creator 版本为 v2.3.0

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    demo: boolean = false
    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        this.node.on('touchstart', () => {
            console.log('touchstart:', this.demo) // 打印出来依旧是false
        })
    }

    start () {

    }

    game_start () {
        this.demo = true
        console.log('game_start:', this.demo) // 打印出来是 true
    }

    // update (dt) {}
}

game_start()在其他脚本里调用的吗?贴上代码

game_start, 在另一个脚本中调用执行, 能够执行成功, 打印出’game_start: true’. 我觉得这个问题是一个引擎的一个bug, 不知道怎么联系官方.

确定game_start的这个方法是在前面执行的吗?这里的打印顺序是什么样的呢

不是,你调用都不知道是在onload之前还是之后,你完整的打印顺序是什么啊