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; private enum AutoBattleAIType{MainStory,StarSoul} private AutoBattleAIType type; public void Awake() { AwakeAsync().Coroutine(); } private async ETVoid AwakeAsync() { zoneScene = this.ZoneScene(); ui = GetParent(); Register(); Load(); await ETTask.CompletedTask; } private void Register() { this.ui.m_comBoxType.self.onChanged.Set(() => { type = (AutoBattleAIType) this.ui.m_comBoxType.self.selectedIndex; }); ui.m_btnStart.self.onClick.Set(async() => { M2C_StartMainStoryAI ret = await zoneScene.GetComponent().Call(new C2M_StartMainStoryAI { Index = (int) this.type }); 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() { } } }