DialogueMono.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using Common.Utility.CombatEvent;
  4. using Excel2Json;
  5. using Fort23.Core;
  6. using Fort23.Mono;
  7. using Fort23.UTool;
  8. using GameLogic.Bag;
  9. using GameLogic.Combat;
  10. using UnityEngine;
  11. namespace GameUI
  12. {
  13. public class DialogueMono : IDialogueMono
  14. {
  15. public void OpenDialoguePanel(int id, string[] icon, ShowDialogueEventData.MessageShowType messageShowType,
  16. Action<int?> finish)
  17. {
  18. DialoguePanel.OpenDialoguePanel(id, icon, messageShowType, finish);
  19. }
  20. public async CTask OpenRewardsPanel(int eventId, List<ItemInfo> rewardsDic, Action onClose = null, int titleId = 0)
  21. {
  22. EventConfig eventConfig = ConfigComponent.Instance.Get<EventConfig>(eventId);
  23. if (eventConfig.EventTriggerType == 2)
  24. {
  25. Vector3 worldPos =CombatDrive.Instance.CombatController.CombatHeroController.playerHeroEntity.combatHeroGameObject.hpTransform.position;
  26. worldPos.y += 0.5f;
  27. await ShowItemNumberCom.Open(worldPos, rewardsDic[0]);
  28. await TimerComponent.Instance.WaitAsync(100);
  29. }
  30. else
  31. {
  32. RewardsPanel rewardsPanel = await RewardsPanel.OpenPanel(rewardsDic, onClose, titleId);
  33. await rewardsPanel.UIClosed();
  34. }
  35. }
  36. public async CTask OpenDialoguePanel(int id, Action<int?> finish)
  37. {
  38. await DialogueBubblePanel.OpenDialoguePanel(id, finish);
  39. }
  40. public void StartCombat(int levelBattle, Action<bool> finishCombat)
  41. {
  42. CombatDrive.Instance.LoadLevelBattleCombat(levelBattle, finishCombat);
  43. }
  44. public void ChangeComabtState(string state)
  45. {
  46. CombatDrive.Instance.CombatController.ChangeState(state);
  47. }
  48. }
  49. }