import { _decorator, Component, Node, tween, UIOpacity } from 'cc'; import { UIBase } from '../../mx/module/ui/UIBase'; import { Tween } from 'cc'; const { ccclass, property } = _decorator; @ccclass('WaitIcon') export class WaitIcon extends UIBase { @property waitTime: number = 0.3; bgMask: Node; icon: Node; onLoad(): void { super.onLoad(); this.bgMask = this.node.find('bgMask'); this.icon = this.node.find('icon'); } onEnable(): void { // this.icon.active = false; // tween(this.bgMask).set({ opacity: 255 }).to(this.waitTime, { opacity: 255 }).call(() => { // this.icon.active = true; // }).start(); } onDisable(): void { Tween.stopAllByTarget(this.bgMask); } }