// Learn TypeScript: // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html // Learn Attribute: // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html const { ccclass, property } = cc._decorator; @ccclass export default class TipMap extends cc.Component { protected start(): void { this.node.scale = 0; this.node.opacity = 0; cc.tween(this.node) .to(0.3, { scale: 1, opacity: 255 }) .delay(0.5) .to(0.3, { scale: 0, opacity: 0 }) .call(() => { this.node.removeFromParent(); }) .start(); } }