58 lines
1.4 KiB
C#
58 lines
1.4 KiB
C#
using Cal.DataTable;
|
|
using FairyGUI;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace ET
|
|
{
|
|
public class NoticeUIAwakeSyatem: AwakeSystem<NoticeUI>
|
|
{
|
|
public override void Awake(NoticeUI self)
|
|
{
|
|
self.Awake();
|
|
}
|
|
}
|
|
|
|
public class NoticeUIDestroySyatem: DestroySystem<NoticeUI>
|
|
{
|
|
public override void Destroy(NoticeUI self)
|
|
{
|
|
self.Destroy();
|
|
}
|
|
}
|
|
|
|
public class NoticeUI: Entity
|
|
{
|
|
public FUI_NoticeUI ui;
|
|
public Action<bool> OnClickDonnotShowBtn;
|
|
private Scene zoneScene;
|
|
private bool isDis;
|
|
private const string filePath = "Assets/Download/Config/updateNotice1.txt";
|
|
|
|
public void Awake()
|
|
{
|
|
zoneScene = this.ZoneScene();
|
|
ui = GetParent<FUI_NoticeUI>();
|
|
AwakeAsync().Coroutine();
|
|
}
|
|
|
|
private async ETVoid AwakeAsync()
|
|
{
|
|
isDis = true;
|
|
this.ui.m_btnNotDisplay.self.selected = !this.isDis;
|
|
this.ui.m_btnNotDisplay.self.onClick.Set(() =>
|
|
{
|
|
isDis = !isDis;
|
|
OnClickDonnotShowBtn?.Invoke(isDis);
|
|
});
|
|
string text = (await ResourceHelper.LoadAssetAsync<TextAsset>(filePath)).text;
|
|
ui.m_title.text = text;
|
|
await ETTask.CompletedTask;
|
|
}
|
|
|
|
public void Destroy()
|
|
{
|
|
}
|
|
}
|
|
} |