Files
aibis-dream/Assets/Scripts/Game Loop/EventEnums.cs
T
2025-01-23 18:32:25 +08:00

69 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using AibisDream.Kit;
using AibisDream.Utility;
using Yarn.Unity;
namespace AibisDream
{
public enum EventEnum
{
NextYarn,
PlugIn,
PlugOut,
Menu
}
public enum DialogEventEnum
{
LineStart,
LineShowed,
LineEnd,
OptionShow,
OptionSelected
}
public enum InteractionEventEnum
{
Start,
End
}
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()
};
}
}
}