86 lines
1.8 KiB
C#
86 lines
1.8 KiB
C#
using AibisDream.Kit;
|
||
using AibisDream.Utility;
|
||
using Yarn.Unity;
|
||
|
||
namespace AibisDream
|
||
{
|
||
public enum EventEnum
|
||
{
|
||
NextYarn,
|
||
PlugIn,
|
||
PlugOut,
|
||
OpenScreen,
|
||
CloseScreen,
|
||
SceneLoad,
|
||
FixStateSwitch
|
||
}
|
||
|
||
public enum GameLoopEnum
|
||
{
|
||
AppStart,
|
||
GameStart,
|
||
GameQuit,
|
||
PauseGame,
|
||
UnPauseGame
|
||
}
|
||
|
||
public enum DialogEventEnum
|
||
{
|
||
LineStart,
|
||
LineShown,
|
||
LineEnd,
|
||
OptionShow,
|
||
OptionSelected
|
||
}
|
||
|
||
public enum InteractionEventEnum
|
||
{
|
||
Start,
|
||
End
|
||
}
|
||
|
||
public struct DialogText
|
||
{
|
||
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 DialogText GetLine(LocalizedLine dialogueLine)
|
||
{
|
||
return new DialogText()
|
||
{
|
||
isOption = false,
|
||
line = dialogueLine.TextWithoutCharacterName.Text,
|
||
lineId = dialogueLine.TextID,
|
||
actor = dialogueLine.GetCharacterVo()
|
||
};
|
||
}
|
||
}
|
||
|
||
public enum StorageEvent
|
||
{
|
||
VariableSet
|
||
}
|
||
} |