代码如下:
const texture2D = new engine.Texture2D();
texture2D.imageSrc = 'sprits/picture/0.png'
// 根据Texure2D创建SpriteFrame
const spriteFrame = engine.SpriteFrame.createFromTexture(texture2D);
let uis: engine.UISprite = this.entity.addComponent(engine.UISprite)
uis.spriteFrame = spriteFrame
加载出来是黑色色块……