12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- 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<ShengShiEventWidget>();
- CombatController.currActiveCombat.CombatSenceController.StartPayShengShi(CombatController.currActiveCombat
- .CombatHeroController.playerHeroEntity.GameObject.transform);
- List<EventConfig> 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>(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<MainPanel>(null);
- }
- }
- }
|