12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using Common.Utility.CombatEvent;
- using Excel2Json;
- using Fort23.Mono;
- using Fort23.UTool;
- using UnityEngine;
- using Utility;
- public class DialogueManager : Singleton<DialogueManager>
- {
- private readonly EventSystemManager eventManager;
- private int currentDialogueID;
- private int currentNodeID;
- private int currentEventID;
- // private List<DialogueConfig> dialogueConfigs;
- // private List<DialogueOptionConfig> dialogueOptionConfigs;
- public void CustomInit()
- {
- // dialogueConfigs = ConfigComponent.Instance.GetAll<DialogueConfig>().ToList();
- // dialogueOptionConfigs = ConfigComponent.Instance.GetAll<DialogueOptionConfig>().ToList();
- }
- /// <summary>
- /// 开始对话
- /// </summary>
- public void StartDialogue(int dialogueID, int eventID)
- {
- currentDialogueID = dialogueID;
- currentNodeID = 1;
- currentEventID = eventID;
- ShowDialogue();
- }
- /// <summary>
- /// 显示当前对话
- /// </summary>
- private void ShowDialogue()
- {
- //找到当前对话组
- // var dialogueConfig = dialogueConfigs.Find(n =>
- // n.ID == currentDialogueID && n.GroupId == currentNodeID);
- // if (dialogueConfig.ID == 0)
- // {
- // EndDialogue();
- // return;
- // }
- //todo 加载对话ui
- // DialoguePanel.OpenDialoguePanel(dialogueConfig.Content, null, ShowDialogueEventData.MessageShowType.Default, () =>
- // {
- //
- // });
- currentNodeID++;
- }
- /// <summary>
- /// 处理选项选择,跳转节点或触发逻辑。
- /// </summary>
- /// <param name="optionID">选项ID</param>
- public void SelectOption(int optionID)
- {
- // var option = dialogueOptionConfigs.Find(o => o.ID == optionID);
- // if (option.ID == 0)
- // {
- // EndDialogue();
- // return;
- // }
- //
- // if (option.DialogueConfigID > 0)
- // {
- // currentNodeID = option.DialogueConfigID;
- // ShowDialogue();
- // }
- // else
- // {
- // EndDialogue();
- // }
- }
- /// <summary>
- /// 结束对话
- /// </summary>
- private void EndDialogue()
- {
- }
- }
|