var url = {
atlasUrl: "http://47.96.2.87:8080/guai.plist", // 图集plist文件地址
atlasTextureUrl: "http://47.96.2.87:8081/guai.png", // 图集纹理图片地址
};
cc.assetManager.loadRemote(url.atlasUrl,function(err, atlas) {
console.log(atlas) //打印ATLAS没有问题
cc.loader.load({url: url.atlasTextureUrl, type: 'png'}, function(err, texture) {
var spriteFrame1 = new cc.SpriteFrame(texture);
ent.getComponent(cc.Sprite).spriteFrame = spriteFrame1 //显示图片也没有问题
var spriteFrame = atlas.getSpriteFrame('1');
atlas.texture = texture;
ent1.getComponent(cc.Sprite).spriteFrame = spriteFrame; //把plist 和png合一就报错 atlas.getSpriteFrame is not a function
});
});
atlas.getSpriteFrame is not a funct。何解