using Cal.DataTable; using ET; using FairyGUI; using System; using System.Collections.Generic; namespace ET { public class QuestUIAwakeSyatem : AwakeSystem { public override void Awake(Quest1UI self) { self.Awake(); } } public class QuestUIStartSyatem : StartSystem { public override void Start(Quest1UI self) { self.Start(); } } public class QuestUIDestroySyatem : DestroySystem { public override void Destroy(Quest1UI self) { self.Destroy(); } } public class Quest1UI : Entity { private FUI_Quest1UI ui; public int cardCount; private Scene zoneScene; public void Awake() { ui = GetParent(); } public void Start() { AwakeAsync().Coroutine(); } private async ETVoid AwakeAsync() { zoneScene = this.ZoneScene(); ui.m_btnStart.onClick.Set(StartAnswer); ui.m_btnRank.onClick.Set(GetScordRank); ui.m_txtCardCount.text = string.Empty + cardCount; ui.m_btnTrans.self.onClick.Set(TransLevel); await ETTask.CompletedTask; } private async void TransLevel() { M2C_TransLevel ret = await zoneScene.GetComponent().Call(new C2M_TransLevel { }); if (!ret.Message.IsNullOrEmpty()) { TipHelper.OpenUI(ret.Message); return; } } private async void StartAnswer() { M2C_StartAnswerQuest ret = await zoneScene.GetComponent().Call(new C2M_StartAnswerQuest { }); if (!ret.Message.IsNullOrEmpty()) { TipHelper.OpenUI(ret.Message); return; } Game.EventSystem.Publish(new ET.EventType.Quest_Answer_Open { zoneScene = ui.ZoneScene(), configId = ret.ConfigId }).Coroutine(); } private async void GetScordRank() { M2C_GetQuestScordInfo ret = await zoneScene.GetComponent().Call(new C2M_GetQuestScordInfo { }); if (!ret.Message.IsNullOrEmpty()) { TipHelper.OpenUI(ret.Message); return; } Game.EventSystem.Publish(new ET.EventType.Quest_Rank_Open { zoneScene = ui.ZoneScene(), list = ret.InfoList }).Coroutine(); } public void Destroy() { } } }