diff --git a/assets/libs/animator-effect/EffectDelayRelease.ts b/assets/libs/animator-effect/EffectDelayRelease.ts index cecc653..e430b1b 100644 --- a/assets/libs/animator-effect/EffectDelayRelease.ts +++ b/assets/libs/animator-effect/EffectDelayRelease.ts @@ -2,7 +2,7 @@ * @Author: dgflash * @Date: 2021-08-11 16:41:12 * @LastEditors: dgflash - * @LastEditTime: 2022-07-25 11:51:15 + * @LastEditTime: 2022-08-05 09:39:40 */ import { Component, _decorator } from 'cc'; @@ -19,7 +19,7 @@ export class EffectDelayRelease extends Component { @property public delay: number = 1; - start() { + protected onEnable() { this.scheduleOnce(this.onDelay, this.delay); } diff --git a/assets/libs/animator-effect/EffectFinishedRelease.ts b/assets/libs/animator-effect/EffectFinishedRelease.ts index 1268aba..f0e2cad 100644 --- a/assets/libs/animator-effect/EffectFinishedRelease.ts +++ b/assets/libs/animator-effect/EffectFinishedRelease.ts @@ -2,7 +2,7 @@ * @Author: dgflash * @Date: 2021-12-30 19:16:47 * @LastEditors: dgflash - * @LastEditTime: 2022-04-07 17:08:44 + * @LastEditTime: 2022-08-05 09:39:33 */ import { Animation, Component, _decorator } from 'cc'; @@ -14,13 +14,13 @@ const { ccclass, property } = _decorator; export class EffectFinishedRelease extends Component { @property({ type: Animation, tooltip: '资源对象池类型名' }) anim: Animation = null!; - + onLoad() { this.anim.on(Animation.EventType.FINISHED, this.onFinished, this); this.anim.on(Animation.EventType.LASTFRAME, this.onFinished, this); } - start() { + protected onEnable() { this.anim.play(); }