对话回顾
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user