0
我想通过一个整数值我回调,这是不按预期工作,因为我可用作为参考。如何将值传递给JavaScript回调/ clousure作为传值
for (var i = this.texturesPath.length - 1; i >= 0; i--) {
var textureIndex = i;
loader.load(baseTexturePath + this.texturesPath[i], function(texture) {
scope.textures[textureIndex] = texture;
});
这种情况下的解决方案/方法是什么?
@ user3804449为什么你投我的答案,我相信是一个正确的答案 – AngelSalazar