对话回顾

This commit is contained in:
2025-01-10 21:39:25 +08:00
parent 62cc381479
commit b7cb09439e
32 changed files with 1083 additions and 2146 deletions
+52
View File
@@ -0,0 +1,52 @@
using AibisDream.Kit;
using AibisDream.Utility;
using Yarn.Unity;
namespace AibisDream
{
public enum EventEnum
{
NextYarn,
DialogLine
}
public struct DialogLine
{
public bool isOption;
public string line;
public CharacterVo actor;
public string lineId;
/// <summary>
/// 获取进行记录的对话
/// </summary>
/// <returns></returns>
public string GetDialogText()
{
// 先去掉换行
var realLine = line.Replace("<br>", "");
if (!isOption)
{
return string.IsNullOrEmpty(actor.GetActorName())
? realLine + "<br>"
: actor.GetActorName() + "" + realLine + "<br>";
}
else
{
return "-> " + realLine + "<br>";
}
}
public static DialogLine GetLine(LocalizedLine dialogueLine)
{
return new DialogLine()
{
isOption = false,
line = dialogueLine.TextWithoutCharacterName.Text,
lineId = dialogueLine.TextID,
actor = dialogueLine.GetCharacterVo()
};
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b0bf5e1e2bd843baa7f669eb56be3808
timeCreated: 1736500984