creator对代码的预处理问题

    console.log("roleView =", this.roleView[0]);
    console.log("roleView =", this.roleView);
    this.roleView.forEach(function(node, B){
        // console.log(node, B);
        node.active = false;
    });

    console.log("roleView =", this.roleView[0]);
    // this.roleView[0].active = true;

最后一行代码去掉,就会报undefine错误。
请问要怎么解决???

creator会把代码全部自动跑上一遍,如何把这个功能关掉

重新打开好了…:kissing_heart:

这个关不掉的……

已经没事了,之前第一次跑的时候,不知道为什么引用的对象变成undefined,默认值应该为[]。重新打开creator正常了。这个问题可以关闭了。