对话系统第一次修改

This commit is contained in:
2025-10-23 21:30:31 +08:00
parent 9fafd91ea5
commit 80b26ade3b
29 changed files with 1361 additions and 1028 deletions
@@ -19,9 +19,6 @@ namespace AibisDream
# endregion
public static UnityAction OnDialogueStart;
public static UnityAction OnDialogueComplete;
private void Start()
{
_dialogueRunner = GetComponentInChildren<DialogueRunner>();
@@ -29,16 +26,16 @@ namespace AibisDream
_dialogueRunner.onDialogueStart.AddListener(() =>
{
EnumEventSystem.Global.Send(InteractionEventEnum.End);
OnDialogueStart?.Invoke();
EnumEventSystem.Global.Send(InteractionEventEnum.DialogEnd);
});
_dialogueRunner.onDialogueComplete.AddListener(() =>
{
EnumEventSystem.Global.Send(InteractionEventEnum.Start);
OnDialogueComplete?.Invoke();
EnumEventSystem.Global.Send(InteractionEventEnum.DialogStart);
});
}
#region Yarn控制
/// <summary>
/// 开启对话
/// </summary>
@@ -49,12 +46,7 @@ namespace AibisDream
_lineProvider.InitStringTable(yarnProject.name);
_dialogueRunner.StartDialogue("Start");
}
public string GetCurLocalizedTableName()
{
return _lineProvider.GetStringTableName();
}
public void StopDialog()
{
_dialogueRunner.Stop();
@@ -84,7 +76,7 @@ namespace AibisDream
_dialogueRunner.StartDialogue(nodeName);
}
}
private bool CheckIfNodeExistInCurrentYarnProject(string nodeName)
{
YarnProject currentProject = _dialogueRunner.yarnProject;
@@ -100,6 +92,8 @@ namespace AibisDream
}
}
#endregion
/// <summary>
/// 跳到下一句
/// </summary>