using ET; using System; using System.Collections.Generic; namespace ET { public static class BattleHelper { public static void StartBattleIdle(Scene zoneScene, Action setBtnSelected) { Game.EventSystem.Publish(new ET.EventType.ShowTipUI { tip = "请输入要挂机的章节:", isClearIpt = true, tipType = TipType.DoubleInput, okAction = async (txt) => { if (!int.TryParse(txt, out int sceneId)) { return; } if (sceneId <= 0) return; M2C_StartBattleIdleFight ret = await zoneScene.GetComponent().Call(new C2M_StartBattleIdleFight { SceneId = sceneId }); if (!ret.Message.IsNullOrEmpty()) { setBtnSelected?.Invoke(false); Game.EventSystem.Publish(new ET.EventType.ShowTipUI { tip = ret.Message, }).Coroutine(); return; } setBtnSelected?.Invoke(true); } }).Coroutine(); } public static async ETVoid EndBattleIdle(Scene zoneScene, Action setBtnSelected) { M2C_EndBattleIdleFight ret = await zoneScene.GetComponent().Call(new C2M_EndBattleIdleFight()); if (!ret.Message.IsNullOrEmpty()) { setBtnSelected?.Invoke(false); Game.EventSystem.Publish(new ET.EventType.ShowTipUI { tip = ret.Message, }).Coroutine(); return; } setBtnSelected?.Invoke(true); } } }