using System.Collections.Generic; using Excel2Json; using Fort23.Core; using GameLogic.Combat.CombatTool; using UnityEngine; namespace Fort23.Mono { [UIBinding(prefab = "MainPanel")] public partial class MainPanel : UIPanel { private void Init() { } protected override void AddEvent() { } protected override void DelEvent() { } public override void AddButtonEvent() { bnt_shengShi.onClick.AddListener(Bnt_shengShi_onClick); } private async void Bnt_shengShi_onClick() { // EventSystemManager.Instance.DetectRandomEvents(); UIManager.Instance.DormancyAllGComponent(); CombatController.currActiveCombat.CombatSenceController.StartPayShengShi(CombatController.currActiveCombat .CombatHeroController.playerHeroEntity.GameObject.transform); List eventConfigs = EventSystemManager.Instance.DetectEvents(1); if (eventConfigs == null || eventConfigs.Count == 0) return; for (var i = 0; i < eventConfigs.Count; i++) { ShengShiEventWidget shengShiEventWidget = await UIManager.Instance.CreateGComponentForObject(ShengShiEventWidget, null, DynamicEvent, isInstance: true); shengShiEventWidget.InitShengShiEventWidget(eventConfigs[i].ID); } } [CustomMethod(CustomMethodType.Update)] public void Update() { if (Input.GetKeyDown(KeyCode.Y)) { EventSystemManager.Instance.DetectRandomEvents(); } } public async static CTask OpenPanel() { await UIManager.Instance.LoadAndOpenPanel(null); } } }