ItemBaiFadeOut.ts
347 Bytes
const { ccclass, property } = cc._decorator;
@ccclass
export default class ItemBaiFadeOut extends cc.Component {
onLoad() { }
onEnable() {
cc.tween(this.node)
.to(0.5, {opacity: 200})
.to(0.5, {opacity: 0})
.call(() => {
this.node.active = false;
}).start();
}
}