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C,EAAE,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC;aAC1D;iBAAM,IAAI,IAAI,CAAC,SAAS,KAAK,aAAa,CAAC,aAAa,EAAE;gBACvD,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;gBACrC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;gBACtC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;aAC9D;QACL,CAAC;QAED,SAAS;YACL,IAAI,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;YAC9D,IAAI,YAAY,EAAE;gBACd,YAAY,CAAC,OAAO,GAAG,KAAK,CAAC;aAChC;YACD,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;QAC/B,CAAC;KACJ,CAAA;IAvEG;QADC,QAAQ;iEACa;IAEtB;QADC,QAAQ;gEACY;IAErB;QADC,QAAQ;8DACU;IAEnB;QADC,QAAQ;8DACW;IAEpB;QADC,QAAQ;iEAC0C;IAEnD;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;+DACG;IAE/B;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC;2EACoB;IAjBpC,0BAA0B;QAD9C,OAAO;OACa,0BAA0B,CA4E9C;IAAD,iCAAC;KAAA;kBA5EoB,0BAA0B","file":"","sourceRoot":"/","sourcesContent":["// Learn TypeScript:\n// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html\n// Learn Attribute:\n// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html\n// Learn life-cycle callbacks:\n// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html\n\nconst { ccclass, property } = cc._decorator;\nenum MoveDirection {\n Clockwise,\n Anticlockwise\n}\n@ccclass\nexport default class SurroundMotionStreakAction extends cc.Component {\n\n // LIFE-CYCLE CALLBACKS:\n\n @property\n moveSpeed: number = 1;\n @property\n fadeTime: number = 1;\n @property\n minSeg: number = 1;\n @property\n stroke: number = 10;\n @property\n direction: MoveDirection = MoveDirection.Clockwise;\n @property({ type: cc.Node })\n actNode: cc.Node = new cc.Node;\n @property({ type: cc.Texture2D })\n motionStreakTexture: cc.Texture2D = new cc.Texture2D;\n private readonly _baseTime: number = 1;\n\n\n onLoad() { }\n\n start() {\n\n }\n\n onEnable() {\n let lt = cc.v2(this.node.width * (-1) / 2, this.node.height / 2);\n let rt = cc.v2(this.node.width / 2, this.node.height / 2);\n let rb = cc.v2(this.node.width / 2, this.node.height * (-1) / 2);\n let lb = cc.v2(this.node.width * (-1) / 2, this.node.height * (-1) / 2);\n let actTime: number = this._baseTime / this.moveSpeed;\n let max = Math.max(this.node.width, this.node.height);\n let wTime = this.node.width / max * actTime;\n let hTime = this.node.height / max * actTime;\n let ltAct = cc.moveTo(hTime, lt);\n let rtAct = cc.moveTo(wTime, rt);\n let rbAct = cc.moveTo(hTime, rb);\n let lbAct = cc.moveTo(wTime, lb);\n if (this.direction === MoveDirection.Anticlockwise) {\n ltAct = cc.moveTo(wTime, lt);\n rtAct = cc.moveTo(hTime, rt);\n rbAct = cc.moveTo(wTime, rb);\n lbAct = cc.moveTo(hTime, lb);\n }\n let seqClockwise = cc.sequence(ltAct, rtAct, rbAct, lbAct);\n let seqAnticlockwise = cc.sequence(rtAct, ltAct, lbAct, rbAct);\n let motionStreak = this.actNode.getComponent(cc.MotionStreak);\n if (!motionStreak) {\n motionStreak = this.actNode.addComponent(cc.MotionStreak);\n motionStreak.texture = this.motionStreakTexture;\n motionStreak.fadeTime = this.fadeTime;\n motionStreak.minSeg = this.minSeg;\n motionStreak.stroke = this.stroke;\n }\n motionStreak.enabled = true;\n this.actNode.stopAllActions();\n if (this.direction === MoveDirection.Clockwise) {\n this.actNode.x = this.node.width * (-1) / 2;\n this.actNode.y = this.node.height / 2;\n this.actNode.runAction(cc.repeatForever(seqClockwise));\n } else if (this.direction === MoveDirection.Anticlockwise) {\n this.actNode.x = this.node.width / 2;\n this.actNode.y = this.node.height / 2;\n this.actNode.runAction(cc.repeatForever(seqAnticlockwise));\n }\n }\n\n onDisable() {\n let motionStreak = this.actNode.getComponent(cc.MotionStreak);\n if (motionStreak) {\n motionStreak.enabled = false;\n }\n this.node.stopAllActions();\n }\n}\n"]}