代码如下,控制台输出值是改了,但是游戏里没有变,我是不是少了哪一步?
if (AmbientInfo.prototype.skyIllum == 0) {
AmbientInfo.prototype.skyIllum = 2222;
} else {
AmbientInfo.prototype.skyIllum = 0;
}
console.log(AmbientInfo.prototype.skyIllum);
已解决:director.getScene().globals.ambient.skyIllum = 30000
新的问题:web端报错:[Browser Preview]Cannot read properties of null (reading ‘globals’)/nTypeError: Cannot read properties of null (reading ‘globals’)