再次尝试稳定快速模式
This commit is contained in:
@@ -177,6 +177,24 @@ namespace AibisDream
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查当前是否有活动的选项显示
|
||||
/// </summary>
|
||||
/// <returns>是否有活动选项</returns>
|
||||
public bool HasActiveOptions()
|
||||
{
|
||||
if (_options == null) return false;
|
||||
|
||||
foreach (var option in _options)
|
||||
{
|
||||
if (option.gameObject.activeSelf)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void HideDialog(Bubble activeBubble)
|
||||
|
||||
@@ -71,7 +71,16 @@ namespace AibisDream
|
||||
{
|
||||
// 无法继续
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检查当前是否有活动的选项显示
|
||||
/// </summary>
|
||||
/// <returns>是否有活动选项</returns>
|
||||
public bool HasActiveOptions()
|
||||
{
|
||||
return gameObject.activeSelf;
|
||||
}
|
||||
|
||||
public void OnLocalizationChanged(string value)
|
||||
{
|
||||
_textParam = JsonUtil.ReadBeanByText<TextParam>(value);
|
||||
|
||||
@@ -100,22 +100,29 @@ namespace AibisDream
|
||||
public void NextStep()
|
||||
{
|
||||
if (_nextStep == null) return;
|
||||
|
||||
|
||||
ClearBox();
|
||||
EnumEventSystem.Global.Send(DialogEventEnum.LineEnd);
|
||||
// 关闭对话
|
||||
var next = _nextStep;
|
||||
_nextStep = null;
|
||||
next.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查当前是否有活动的选项显示
|
||||
/// </summary>
|
||||
/// <returns>是否有活动选项</returns>
|
||||
public bool HasActiveOptions()
|
||||
{
|
||||
return _choiceBox != null && _choiceBox.activeSelf;
|
||||
}
|
||||
|
||||
public void OnLocalizationChanged(string value)
|
||||
{
|
||||
_textParam = JsonUtil.ReadBeanByText<TextParam>(value);
|
||||
|
||||
var tmp = _dialogText.GetComponent<TMP_Text>();
|
||||
// 修改对话文本
|
||||
tmp.characterSpacing = _textParam.charSpace;
|
||||
_actorName.characterSpacing = _textParam.charSpace;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace AibisDream
|
||||
|
||||
private bool _isNextAutoSkip;
|
||||
private bool _isNextBlocked;
|
||||
private bool _isProcessingOptions; // 标记是否正在处理选项
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -84,7 +85,7 @@ namespace AibisDream
|
||||
AddDialogueLine));
|
||||
_rmvList.Add(
|
||||
EnumEventSystem.Global.Register<DialogEventEnum, DialogText>(DialogEventEnum.OptionSelected,
|
||||
AddDialogueLine));
|
||||
OnOptionSelected));
|
||||
_rmvList.Add(EnumEventSystem.Global.Register(EventEnum.NextYarn, CleanDialogHistory));
|
||||
|
||||
// 文本显示事件
|
||||
@@ -142,6 +143,12 @@ namespace AibisDream
|
||||
_autoNext = null;
|
||||
}
|
||||
|
||||
private void OnOptionSelected(DialogText dialogText)
|
||||
{
|
||||
_isProcessingOptions = false; // 清除处理选项的标志
|
||||
AddDialogueLine(dialogText); // 记录选项
|
||||
}
|
||||
|
||||
public override void OnSingletonDestroy()
|
||||
{
|
||||
// 销毁前处理事件
|
||||
@@ -233,6 +240,8 @@ namespace AibisDream
|
||||
|
||||
public void ShowOptions(DialogOption[] dialogueOptions)
|
||||
{
|
||||
_isProcessingOptions = true; // 设置正在处理选项的标志
|
||||
|
||||
var viewType = dialogueOptions[0].Character.dialogViewType;
|
||||
// 根据状况选择不同的选择框
|
||||
if (viewType == DialogViewType.Default)
|
||||
@@ -268,6 +277,7 @@ namespace AibisDream
|
||||
|
||||
public void HideDialog()
|
||||
{
|
||||
_isProcessingOptions = false; // 清除处理选项的标志
|
||||
_showingView?.HideDialog();
|
||||
}
|
||||
|
||||
@@ -283,6 +293,7 @@ namespace AibisDream
|
||||
|
||||
public void NextStep()
|
||||
{
|
||||
_isProcessingOptions = false; // 清除处理选项的标志
|
||||
var view = _showingView;
|
||||
_hideDialog = ActionKit.Delay(autoHideDuration, () =>
|
||||
{
|
||||
@@ -296,6 +307,32 @@ namespace AibisDream
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查当前是否有活动的选项显示
|
||||
/// </summary>
|
||||
/// <returns>是否有活动选项</returns>
|
||||
public bool HasActiveOptions()
|
||||
{
|
||||
// 如果正在处理选项,返回true
|
||||
if (_isProcessingOptions)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// 检查当前显示的对话框是否有选项
|
||||
if (_showingView != null)
|
||||
{
|
||||
// 通过反射检查当前对话框是否有选项显示
|
||||
var hasOptionsMethod = _showingView.GetType().GetMethod("HasActiveOptions",
|
||||
System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance);
|
||||
if (hasOptionsMethod != null)
|
||||
{
|
||||
return (bool)hasOptionsMethod.Invoke(_showingView, null);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void SwitchDialogView(DialogViewType dialogViewType)
|
||||
{
|
||||
if (_dialogViewDict.TryGetValue(dialogViewType, out var view))
|
||||
|
||||
Reference in New Issue
Block a user