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AE,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QAExC,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC;QAExB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACnC,IAAI,CAAC,SAAS,CACb,EAAE,CAAC,QAAQ,CACV,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,GAAG,GAAG,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EACrD,EAAE,CAAC,QAAQ,CAAC;YACX,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACrB,CAAC,CAAC,CACF,CACD,CAAC;IACH,CAAC;IAhGmB,KAAK;QADzB,OAAO;OACa,KAAK,CAiGzB;IAAD,YAAC;CAjGD,AAiGC,CAjGkC,EAAE,CAAC,SAAS,GAiG9C;kBAjGoB,KAAK","file":"","sourceRoot":"/","sourcesContent":["const {ccclass, property} = cc._decorator;\nconst RandomInteger = function (e, t) {\n\treturn Math.floor(Math.random() * (t - e) + e);\n};\n@ccclass\nexport default class Juice extends cc.Component {\n\t// @property(cc.SpriteFrame)\n\tparticle: cc.SpriteFrame = null;\n\t// @property(cc.SpriteFrame)\n\tcircle: cc.SpriteFrame = null;\n\t// @property(cc.SpriteFrame)\n\tslash: cc.SpriteFrame = null;\n\n\tinit(data) {\n\t\tthis.particle = data.particle;\n\t\tthis.circle = data.particle;\n this.slash = data.slash;\n\t}\n\n\t// 合并时的动画效果\n\tshowJuice(pos, width) {\n\t\t// 果粒\n\t\tfor (let i = 0; i < 10; ++i) {\n\t\t\tconst node = new cc.Node('Sprite');\n\t\t\tconst sp = node.addComponent(cc.Sprite);\n\n\t\t\tsp.spriteFrame = this.particle;\n\t\t\tnode.parent = this.node;\n\n\t\t\tconst a = 359 * Math.random(),\n\t\t\t\ti = 30 * Math.random() + width / 2,\n\t\t\t\tl = cc.v2(\n\t\t\t\t\tMath.sin((a * Math.PI) / 180) * i,\n\t\t\t\t\tMath.cos((a * Math.PI) / 180) * i\n\t\t\t\t);\n\t\t\tnode.scale = 0.5 * Math.random() + width / 100;\n\t\t\tconst p = 0.5 * Math.random();\n\n node.position = pos;\n \n\t\t\tnode.runAction(\n\t\t\t\tcc.sequence(\n\t\t\t\t\tcc.spawn(\n\t\t\t\t\t\tcc.moveBy(p, l),\n\t\t\t\t\t\tcc.scaleTo(p + 0.5, 0.3),\n\t\t\t\t\t\tcc.rotateBy(p + 0.5, RandomInteger(-360, 360))\n\t\t\t\t\t),\n\t\t\t\t\tcc.fadeOut(0.1),\n\t\t\t\t\tcc.callFunc(function () {\n\t\t\t\t\t\tnode.active = false;\n\t\t\t\t\t}, this)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// 水珠\n\t\tfor (let f = 0; f < 20; f++) {\n\t\t\tconst node = new cc.Node('Sprite');\n\t\t\tconst sp = node.addComponent(cc.Sprite);\n\n\t\t\tsp.spriteFrame = this.circle;\n\t\t\tnode.parent = this.node;\n\n\t\t\tlet a = 359 * Math.random(),\n\t\t\t\ti = 30 * Math.random() + width / 2,\n\t\t\t\tl = cc.v2(\n\t\t\t\t\tMath.sin((a * Math.PI) / 180) * i,\n\t\t\t\t\tMath.cos((a * Math.PI) / 180) * i\n\t\t\t\t);\n\t\t\tnode.scale = 0.5 * Math.random() + width / 100;\n\t\t\tlet p = 0.5 * Math.random();\n\t\t\tnode.position = pos;\n\t\t\tnode.runAction(\n\t\t\t\tcc.sequence(\n\t\t\t\t\tcc.spawn(cc.moveBy(p, l), cc.scaleTo(p + 0.5, 0.3)),\n\t\t\t\t\tcc.fadeOut(0.1),\n\t\t\t\t\tcc.callFunc(function () {\n\t\t\t\t\t\tnode.active = false;\n\t\t\t\t\t}, this)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// 果汁\n\t\tconst node = new cc.Node('Sprite');\n\t\tconst sp = node.addComponent(cc.Sprite);\n\n\t\tsp.spriteFrame = this.slash;\n\t\tnode.parent = this.node;\n\n\t\tnode.position = pos;\n\t\tnode.scale = 0;\n\t\tnode.angle = RandomInteger(0, 360);\n\t\tnode.runAction(\n\t\t\tcc.sequence(\n\t\t\t\tcc.spawn(cc.scaleTo(0.2, width / 150), cc.fadeOut(1)),\n\t\t\t\tcc.callFunc(function () {\n\t\t\t\t\tnode.active = false;\n\t\t\t\t})\n\t\t\t)\n\t\t);\n\t}\n}\n"]} |