import EventMgr from "../game/EventMgr"; import { GameEvent } from "../game/GameEvent"; import Main from "../game/Main"; const {ccclass, property} = cc._decorator; @ccclass export default class endlessRoundPanel extends cc.Component { @property(cc.Label) lbRound: cc.Label = null; // LIFE-CYCLE CALLBACKS: // onLoad () {} protected onLoad(): void { EventMgr.Instance.add_event_listenner(GameEvent.EndlessGameNewRound,this,this.OnEndlessGameNewRound); this.node.active = false; } OnEndlessGameNewRound() { let me = this; this.lbRound.string = "第"+Main.Ins.Round+"波"; this.node.active = true; this.node.scaleY=0; let tween = cc.tween(this.node); tween.to(0.3,{opacity:255,scaleY:1}).delay(1).to(0.3,{opacity:0,scaleY:0}).call(function(){me.node.active = false}).start(); } protected onDestroy(): void { EventMgr.Instance.remove_event_listenner(GameEvent.EndlessGameNewRound,this,this.OnEndlessGameNewRound); } // update (dt) {} }