From afcb351066e8304ff6826ba668d30cd78073ab83 Mon Sep 17 00:00:00 2001 From: dgflash Date: Fri, 5 Aug 2022 09:41:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=89=B9=E6=95=88=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E6=B1=A0=E4=B8=AD=E4=BA=8C=E6=AC=A1=E5=8F=96=E5=87=BA?= =?UTF-8?q?=E7=89=B9=E6=95=88=E5=AF=B9=E8=B1=A1=E4=BD=BF=E7=94=A8=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E8=87=AA=E5=8A=A8=E6=92=AD=E4=BB=8E=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E5=B8=A7=E5=BC=80=E5=A7=8B=E6=92=AD=E6=94=BE=E5=8A=A8?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/libs/animator-effect/EffectDelayRelease.ts | 4 ++-- assets/libs/animator-effect/EffectFinishedRelease.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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(); }