using Cal.DataTable; using ET.EventType; using ET; using FairyGUI; using System; using System.Collections.Generic; using UnityEngine; using System.Linq; using System.Text; namespace ET { public class MainStoryAIUIAwakeSyatem : AwakeSystem { public override void Awake(MainStoryAIUI self) { self.Awake(); } } public class MainStoryAIUIDestroySyatem : DestroySystem { public override void Destroy(MainStoryAIUI self) { self.Destroy(); } } public class MainStoryAIUI : Entity { public FUI_MainStoryAIUI ui; private Scene zoneScene; public void Awake() { AwakeAsync().Coroutine(); } private async ETVoid AwakeAsync() { zoneScene = this.ZoneScene(); ui = GetParent(); Register(); Load(); await ETTask.CompletedTask; } private void Register() { ui.m_btnStart.self.onClick.Set(async() => { if(!int.TryParse( ui.m_iptLevel.text,out int index)) { TipHelper.OpenUI("填写错误"); return; } M2C_StartMainStoryAI ret = await zoneScene.GetComponent().Call(new C2M_StartMainStoryAI { Index = index }); if (!ret.Message.IsNullOrEmpty()) { TipHelper.OpenUI(ret.Message); return; } }); ui.m_btnEnd.self.onClick.Set(async() => { M2C_EndMainStoryAI ret = await zoneScene.GetComponent().Call(new C2M_EndMainStoryAI()); if (!ret.Message.IsNullOrEmpty()) { TipHelper.OpenUI(ret.Message); return; } }); } private void Load() { } public void Destroy() { } } }