let jsZip = new JSZip() // console.log(jsZip) let zip = await jsZip.loadAsync(res._nativeAsset) if (zip) { let file1 = await zip.file('data1.json').async('string') let file2 = await zip.file('data2.json').async('string') let file3 = await zip.file('data3.json').async('string') let file4 = await zip.file('data4.json').async('string') let file5 = await zip.file('test.b64.txt').async('string') let file6 = await zip.file('dou.png').async('uint8array') console.log(file6.byteLength)
let image = new Image() image.src = file5 image.onload = () => { let tex = new cc.Texture2D() tex.initWithElement(image) let spf = new cc.SpriteFrame(tex) let node = new cc.Node() let sp = node.addComponent(cc.Sprite) sp.spriteFrame = spf this.node.addChild(node, -2) } } } }) }