Merge branch 'develop' into feature/yingli

This commit is contained in:
2025-08-01 15:26:16 +08:00
219 changed files with 31866 additions and 7737 deletions
@@ -72,6 +72,13 @@ namespace AibisDream
public void StartDialogNode(string nodeName)
{
// 检查对话是否正在运行
if (_dialogueRunner.IsDialogueRunning)
{
Debug.LogWarning($"对话正在运行中,无法启动新节点: {nodeName}");
return;
}
if (CheckIfNodeExistInCurrentYarnProject(nodeName))
{
_dialogueRunner.StartDialogue(nodeName);
+30 -1
View File
@@ -1,6 +1,8 @@
using System;
using AibisDream.Framework;
using AibisDream.Kit;
using AibisDream.Utility;
using UnityEngine;
using Yarn.Unity;
namespace AibisDream
@@ -9,25 +11,52 @@ namespace AibisDream
{
public override void RunLine(LocalizedLine dialogueLine, Action onDialogueLineFinished)
{
string lineId = dialogueLine.TextID;
string shortText = dialogueLine.TextWithoutCharacterName.Text.Length > 30
? dialogueLine.TextWithoutCharacterName.Text.Substring(0, 30) + "..."
: dialogueLine.TextWithoutCharacterName.Text;
Debug.Log($"[对话流程] [{lineId}] ===== 开始处理 =====");
Debug.Log($"[对话流程] [{lineId}] 文本内容: {shortText}");
EnumEventSystem.Global.Send(DialogEventEnum.LineStart, DialogText.GetLine(dialogueLine));
HandleLineOutput(dialogueLine, onDialogueLineFinished);
if (DialogController.Instance.quickRunMode)
{
DialogCanvasManager.Instance.TrySkipLine(true);
Debug.Log($"[快速模式] [{lineId}] ===== 快速处理开始 =====");
// 快速模式:直接跳过文本显示并继续
bool skipResult = DialogCanvasManager.Instance.TrySkipLine(true);
Debug.Log($"[快速模式] [{lineId}] TrySkipLine结果: {skipResult}");
EnumEventSystem.Global.Send(DialogEventEnum.LineShown);
Debug.Log($"[快速模式] [{lineId}] LineShown事件已发送");
DialogCanvasManager.Instance.NextStep();
Debug.Log($"[快速模式] [{lineId}] NextStep已调用");
Debug.Log($"[快速模式] [{lineId}] ===== 快速处理完成 =====");
}
else
{
Debug.Log($"[正常模式] [{lineId}] 等待用户交互");
}
Debug.Log($"[对话流程] [{lineId}] ===== 处理完成 =====");
}
private void HandleLineOutput(LocalizedLine dialogueLine, Action onDialogueLineFinished)
{
string lineId = dialogueLine.TextID;
Debug.Log($"[文本显示] [{lineId}] 开始显示文本");
DialogCanvasManager.Instance.ShowLine(dialogueLine.TextWithoutCharacterName.Text,
dialogueLine.GetCharacterVo(), onDialogueLineFinished, dialogueLine.TextID, dialogueLine.IsAutoSkipLine());
}
public override void RunOptions(DialogueOption[] dialogueOptions, Action<int> onOptionSelected)
{
Debug.Log($"[选项显示] ===== 显示 {dialogueOptions.Length} 个选项 =====");
EnumEventSystem.Global.Send(DialogEventEnum.OptionShow);
var options = DialogOption.GeneOptions(dialogueOptions, onOptionSelected);
DialogCanvasManager.Instance.ShowOptions(options);