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vB;QADC,QAAQ;mDACS;IAElB;QADC,QAAQ;wDACgB;IAEzB;QADC,QAAQ;wDACc;IAEvB;QADC,QAAQ;4DACoB;IAVZ,gBAAgB;QADpC,OAAO;OACa,gBAAgB,CAoCpC;IAAD,uBAAC;KAAA;kBApCoB,gBAAgB","file":"","sourceRoot":"/","sourcesContent":["\nconst { ccclass, property } = cc._decorator;\n\n@ccclass\nexport default class FadeChangeAction extends cc.Component {\n @property\n loopTimes: number = -1;\n @property\n speed: number = 1;\n @property\n opacityMax: number = 255;\n @property\n opacityMin: number = 0;\n @property\n defaultOpacity: number = 255;\n\n private readonly _baseTime: number = 1;\n private _loopCount: number = 0;\n\n onEnable() {\n let actTime: number = this._baseTime / this.speed;\n if ((-1) === this.loopTimes) {\n cc.tween(this.node)\n .to(actTime, { opacity: this.opacityMax })\n .to(actTime, { opacity: this.opacityMin })\n .union()\n .repeatForever()\n .start();\n }\n }\n\n onDisable() {\n this.resetToDefault();\n }\n\n resetToDefault() {\n this._loopCount = 0;\n this.node.stopAllActions();\n this.node.opacity = this.defaultOpacity;\n }\n}\n"]}