this.babyEyeTimer = 0;
这句话中的 babyEyeTimer 显示灰色 提示 Unused defintion babyEyeTimer 是什么意思
我也出现了这个错,然后发现是因为我的interval初始化为0了。。所以this.babyEyeTimer %= this.babyEyeInterval会出现NaN的情况。。
this.babyEyeTimer定义了未使用,检查baby.js的draw方法里那块代码是否有误
this.babyEyeTimer += deltaTime; if (this.babyEyeTimer > this.babyEyeInterval) { this.babyEyeCount = (this.babyEyeCount + 1) % 2; this.babyEyeTimer %= this.babyEyeInterval; if (this.babyEyeCount == 0) { this.babyEyeInterval = Math.random() * 1500 + 2000; } else { this.babyEyeInterval = 200; } }