using ET; using System; using System.Collections.Generic; namespace ET { public class NoticeUIAwakeSyatem : AwakeSystem { public override void Awake(NoticeUI self) { self.Awake(); } } public class NoticeUIDestroySyatem : DestroySystem { public override void Destroy(NoticeUI self) { self.Destroy(); } } public class NoticeUI : Entity { public FUI_NoticeUI ui; public Action closeAction; private bool isNotDisplayNotice; private Scene zoneScene; public void Awake() { zoneScene = this.ZoneScene(); ui = GetParent(); isNotDisplayNotice = false; AwakeAsync().Coroutine(); } private async ETVoid AwakeAsync() { G2C_GetNotice ret = await zoneScene.GetComponent().Call(new C2G_GetNotice()); ui.m_title.text = ret.Notice; ui.m_btnNotDisplay.self.onClick.Set(() => { isNotDisplayNotice = !isNotDisplayNotice; }); await ETTask.CompletedTask; } public void Destroy() { if (isNotDisplayNotice) closeAction?.Invoke(); } } }