📅  最后修改于: 2022-03-11 15:00:33.904000             🧑  作者: Mango
const self = this;
const url = 'test_assets/test_altas/content';
resources.load(url, ImageAsset, (err: any, imageAsset) => {
const sprite = this.getComponent(Sprite);
const spriteFrame = new SpriteFrame();
const tex = new Texture2D();
tex.image = imageAsset;
spriteFrame.texture = tex;
sprite.spriteFrame = spriteFrame;
});