文本系统重做完成
This commit is contained in:
@@ -13,8 +13,6 @@ namespace AibisDream
|
||||
|
||||
[SerializeField] private LineAdvanceInput lineAdvanceInput;
|
||||
|
||||
public AdvanceMode advanceMode;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_dialogueRunner = GetComponentInChildren<DialogueRunner>();
|
||||
@@ -33,11 +31,17 @@ namespace AibisDream
|
||||
private void OnEnable()
|
||||
{
|
||||
EnumEventSystem.Global.Register(GameLoopEnum.GameStart, ResetAdvanceMode);
|
||||
|
||||
EnumEventSystem.Global.Register(DialogEventEnum.OptionShow, OnOptionShow);
|
||||
EnumEventSystem.Global.Register<DialogEventEnum, LineInfo>(DialogEventEnum.OptionSelected, OnOptionSelected);
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
EnumEventSystem.Global.UnRegister(GameLoopEnum.GameStart, ResetAdvanceMode);
|
||||
|
||||
EnumEventSystem.Global.UnRegister(DialogEventEnum.OptionShow, OnOptionShow);
|
||||
EnumEventSystem.Global.UnRegister<DialogEventEnum, LineInfo>(DialogEventEnum.OptionSelected, OnOptionSelected);
|
||||
}
|
||||
|
||||
private void ResetAdvanceMode()
|
||||
@@ -48,6 +52,9 @@ namespace AibisDream
|
||||
isQuick = false
|
||||
};
|
||||
|
||||
isInOption = false;
|
||||
lineSyncToken = null;
|
||||
|
||||
Time.timeScale = 1f;
|
||||
lineAdvanceInput.ResetAdvanceMode();
|
||||
}
|
||||
@@ -113,6 +120,8 @@ namespace AibisDream
|
||||
|
||||
#region 推进方式修改
|
||||
|
||||
public AdvanceMode advanceMode;
|
||||
|
||||
public void SwitchAutoMode()
|
||||
{
|
||||
advanceMode.isAuto = !advanceMode.isAuto;
|
||||
@@ -128,8 +137,36 @@ namespace AibisDream
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public LineSyncToken lineSyncToken;
|
||||
public bool isInOption;
|
||||
|
||||
public LineSyncState GetDialogState()
|
||||
{
|
||||
if (lineSyncToken != null && lineSyncToken.state != LineSyncState.Advanced)
|
||||
{
|
||||
return lineSyncToken.state;
|
||||
}
|
||||
else if (isInOption)
|
||||
{
|
||||
return LineSyncState.InOption;
|
||||
}
|
||||
else
|
||||
{
|
||||
return LineSyncState.Default;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnOptionShow()
|
||||
{
|
||||
isInOption = true;
|
||||
}
|
||||
|
||||
private void OnOptionSelected(LineInfo lineInfo)
|
||||
{
|
||||
isInOption = false;
|
||||
}
|
||||
}
|
||||
|
||||
public struct AdvanceMode
|
||||
{
|
||||
@@ -140,14 +177,14 @@ namespace AibisDream
|
||||
{
|
||||
get
|
||||
{
|
||||
if (isAuto)
|
||||
{
|
||||
return AdvanceModeEnum.Auto;
|
||||
}
|
||||
else if (isQuick)
|
||||
if (isQuick)
|
||||
{
|
||||
return AdvanceModeEnum.Quick;
|
||||
}
|
||||
else if (isAuto)
|
||||
{
|
||||
return AdvanceModeEnum.Auto;
|
||||
}
|
||||
else
|
||||
{
|
||||
return AdvanceModeEnum.Default;
|
||||
|
||||
Reference in New Issue
Block a user