You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdLike2048/assets/script/ui/WaitIcon.ts

34 lines
783 B

3 weeks ago
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);
}
}