//#region 文件引入 import { _decorator, Button, Component, Label, Node, sp, Sprite,Animation, RichText } from "cc"; import BaseUIForm from "../../Mgr_UI/BaseUIForm"; import { Global } from "../../Global"; import { RedNotice } from "../../Mgr_RedPoint/RedNotice"; import { EGlobalEvent } from "../../MesEvent/EGlobalEvent"; import { HomeUIRedEnum, MainRedEnum } from "../../Mgr_RedPoint/RedEnumType"; //#endregion 文件引入 const {ccclass, property,menu} = _decorator; @ccclass("PopNoticeUI_Proxy") export default class PopNoticeUI_Proxy extends BaseUIForm{ //#region 节点自动生成 @property(RichText) ric_content: RichText = null; @property(Button) btn_close: Button = null; //#endregion 节点自动生成 onButtonClick(button:Button){ /**点击事件触发*/ switch (button) { case this.btn_close: this.CloseUI(); break; default: ConsoleEx.Log(button); break; } } protected start(): void { const notice = Global.CsvMgr.GetNoticeData(); if(notice){ this.mDataMgr.Game.NoticeDays = notice.timenum; CNodeUtils.switchRichText(this.ric_content, notice.content); RedNotice.emit(EGlobalEvent.E_RED_UPDATE,[MainRedEnum.游历, HomeUIRedEnum.打开公告]); } } }