import { _decorator, Component, Node, Animation, systemEvent, SystemEvent, Label, Sprite } from 'cc'; import { DataSystem } from '../../core/data/DataSystem'; import { BattleUIData } from './BattleUIData'; const { ccclass, property } = _decorator; @ccclass('MissionBanner') export class MissionBanner extends Component { @property({ type: Animation, tooltip: "banner动画" }) animation: Animation; @property({ type: Label, tooltip: "关卡文本" }) missionLabel: Label; @property({ type: Node, tooltip: "Boss图标" }) bossIcon: Node; start() { this.animation.on(Animation.EventType.FINISHED, () => { this.node.destroy(); }, this); } public setData(mission: number, isBoss: boolean): void { this.bossIcon.active = isBoss; this.missionLabel.string = `第${mission}关`; this.animation.play(); this.animation.on(Animation.EventType.FINISHED, this.onFinsih, this); } public onFinsih(): void { DataSystem.getData(BattleUIData)._bannerRunOver = true; } }