1 line
2.6 KiB
Plaintext

{"version":3,"sources":["assets/multi-render/multi-batcher/multi-batcher.ts"],"names":["_a","cc","_decorator","ccclass","property","MultiBatcher","_super","__extends","_this","apply","this","arguments","batchBtn","cancelBtn","textures","prototype","onLoad","on","batcher","sp","init","children","forEach","v","sprite","getComponent","Sprite","requsetMaterial","spriteFrame","getTexture","setVertsDirty","unlinkMaterial","setMaterial","Material","getBuiltinMaterial","__decorate","Node","Component","exports","default"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACM,IAAAA,KAAAC,GAAAC,YAAAC,UAAAH,GAAAG,SAAAC,WAAAJ,GAAAI;IAGN,IAAAC,eAAA,SAAAC;MAA0CC,UAAAF,cAAAC;MAA1C,SAAAD;QAAA,IAAAG,QAAA,SAAAF,UAAAA,OAAAG,MAAAC,MAAAC,cAAAD;QAGIF,MAAAI,WAAA;QAGAJ,MAAAK,YAAA;QAGAL,MAAAM,WAAA;;;MAGUT,aAAAU,UAAAC,SAAA;QAAV,IAAAR,QAAAE;QACIA,KAAAE,SAAAK,GAAA,SAAA;UACI,IAAAC,UAAA,IAAAjB,GAAAkB,GAAAd;UACAa,QAAAE;UACAZ,MAAAM,SAAAO,SAAAC,QAAA,SAAAC;YACI,IAAAC,SAAAD,EAAAE,aAAAxB,GAAAyB;YACAR,QAAAS,gBAAAH,OAAAI,YAAAC;YACAL,OAAAM;;;QAIRpB,KAAAG,UAAAI,GAAA,SAAA;UACIT,MAAAM,SAAAO,SAAAC,QAAA,SAAAC;YACI,IAAAC,SAAAD,EAAAE,aAAAxB,GAAAyB;YACAF,OAAAI,YAAAC,aAAAE;YACAP,OAAAQ,YAAA,GAAA/B,GAAAgC,SAAAC,mBAAA;YACAV,OAAAM;;;;MAzBZK,WAAA,EADC/B,SAAAH,GAAAmC,SACwB/B,aAAAU,WAAA,iBAAA;MAGzBoB,WAAA,EADC/B,SAAAH,GAAAmC,SACyB/B,aAAAU,WAAA,kBAAA;MAG1BoB,WAAA,EADC/B,SAAAH,GAAAmC,SACwB/B,aAAAU,WAAA,iBAAA;MATRV,eAAA8B,WAAA,EADpBhC,WACoBE;MAiCrB,OAAAA;KAjCA,CAAAJ,GAAAoC;IAAqBC,QAAAC,UAAAlC","sourcesContent":["\nconst { ccclass, property } = cc._decorator;\n\n@ccclass\nexport default class MultiBatcher extends cc.Component {\n\n @property(cc.Node)\n batchBtn: cc.Node = null;\n\n @property(cc.Node)\n cancelBtn: cc.Node = null;\n\n @property(cc.Node)\n textures: cc.Node = null;\n\n\n protected onLoad(): void {\n this.batchBtn.on('click', () => {\n const batcher = new cc.sp.MultiBatcher();\n batcher.init();\n this.textures.children.forEach(v => {\n const sprite = v.getComponent(cc.Sprite);\n batcher.requsetMaterial(sprite.spriteFrame.getTexture());\n sprite.setVertsDirty();\n });\n });\n\n this.cancelBtn.on('click', () => {\n this.textures.children.forEach(v => {\n const sprite = v.getComponent(cc.Sprite);\n sprite.spriteFrame.getTexture().unlinkMaterial();\n sprite.setMaterial(0, cc.Material.getBuiltinMaterial('2d-sprite'));\n sprite.setVertsDirty();\n });\n });\n }\n\n}\n"],"file":"index.js"}