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QACpE,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,KAAK;YAChB,IAAI,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;gBAC3C,IAAI,MAAM,GAAG,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;gBAC3B,MAAM,CAAC,IAAI,GAAG,aAAa,CAAC;gBAC5B,IAAI,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;gBACxC,EAAE,CAAC,WAAW,GAAG,MAAM,4BAAQ,CAAC,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC;gBACnF,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC;gBAC1B,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;gBACxE,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE;oBACnB,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;wBACpB,MAAM,CAAC,OAAO,EAAE,CAAC;qBACpB;gBACL,CAAC,EAAE,GAAG,CAAC,CAAC;aACX;QAEL,CAAC;KACJ,CAAA;IArCoB,mBAAmB;QAFvC,OAAO;QACP,IAAI,CAAC,6BAA6B,CAAC;OACf,mBAAmB,CAqCvC;IAAD,0BAAC;KAAA;kBArCoB,mBAAmB","file":"","sourceRoot":"/","sourcesContent":["import { ResUtils } from \"simba-cc-resutils\";\n\nconst { ccclass, property, menu } = cc._decorator;\n\n@ccclass\n@menu(\"自定义UI组件/TouchSpecialEffComp\")\nexport default class TouchSpecialEffComp extends cc.Component {\n\n onLoad() {\n\n }\n\n onEnable() {\n this.node.on(cc.Node.EventType.TOUCH_START, this.callback, this, false);\n this.node.on(cc.Node.EventType.TOUCH_MOVE, this.callback, this, false);\n this.node.on(cc.Node.EventType.TOUCH_END, this.callback, this, false);\n this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.callback, this, false);\n }\n\n onDestroy() {\n this.node.off(cc.Node.EventType.TOUCH_END, this.callback, this);\n }\n\n onDisable() {\n this.node.off(cc.Node.EventType.TOUCH_END, this.callback, this);\n }\n\n async callback(event) {\n if (event.type == cc.Node.EventType.TOUCH_END) {\n let spNode = new cc.Node();\n spNode.name = \"touchSpNode\";\n let sp = spNode.addComponent(cc.Sprite);\n sp.spriteFrame = await ResUtils.loadRes(\"textures/common/gift_AD\", cc.SpriteFrame);\n spNode.parent = this.node;\n spNode.setPosition(this.node.convertToNodeSpaceAR(event.getLocation()));\n this.scheduleOnce(() => {\n if (cc.isValid(spNode)) {\n spNode.destroy();\n }\n }, 0.5);\n }\n\n }\n}\n"]}