dialog问题修改
This commit is contained in:
@@ -27,7 +27,7 @@ namespace AibisDream
|
||||
{
|
||||
InitQuickTalkButton();
|
||||
InitEvent();
|
||||
|
||||
|
||||
// 默认对话框直接加载
|
||||
var box = transform.Find("Dialog Box").GetComponent<IDialogView>();
|
||||
RegisterDialogView(DialogViewType.OldBox, box);
|
||||
@@ -129,7 +129,7 @@ namespace AibisDream
|
||||
{
|
||||
_lastShowView?.HideDialog();
|
||||
}
|
||||
|
||||
|
||||
_lastShowView = _curView;
|
||||
// 没有指定对话框,就用当前激活的
|
||||
_curView.ShowLine(dialogLine, character, nextStep, onTextShowed, isAutoSkip);
|
||||
@@ -140,7 +140,7 @@ namespace AibisDream
|
||||
{
|
||||
_lastShowView?.HideDialog();
|
||||
}
|
||||
|
||||
|
||||
_lastShowView = view;
|
||||
// 对于指定了对话框的,就在指定对话框显示
|
||||
view.ShowLine(dialogLine, character, nextStep, onTextShowed, isAutoSkip);
|
||||
@@ -161,7 +161,7 @@ namespace AibisDream
|
||||
}
|
||||
else
|
||||
{
|
||||
_dialogViewDict[viewType].ShowOptions(dialogueOptions);
|
||||
_dialogViewDict[viewType].ShowOptions(dialogueOptions);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,12 +172,12 @@ namespace AibisDream
|
||||
|
||||
public bool TrySkipLine()
|
||||
{
|
||||
return _lastShowView.TrySkipLine();
|
||||
return _lastShowView != null && _lastShowView.TrySkipLine();
|
||||
}
|
||||
|
||||
public void NextStep()
|
||||
{
|
||||
_lastShowView.NextStep();
|
||||
_lastShowView?.NextStep();
|
||||
}
|
||||
|
||||
public void SwitchDialogView(DialogViewType dialogViewType)
|
||||
@@ -185,6 +185,7 @@ namespace AibisDream
|
||||
if (_dialogViewDict.TryGetValue(dialogViewType, out var view))
|
||||
{
|
||||
_curView.HideDialog();
|
||||
_lastShowView?.HideDialog();
|
||||
_lastShowView = null;
|
||||
_curView = view;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,10 @@ namespace AibisDream
|
||||
// 注册泡泡
|
||||
DialogCanvasManager.Instance.RegisterDialogView(DialogViewType.Bubble, this);
|
||||
DialogCanvasManager.Instance.SwitchDialogView(DialogViewType.Bubble);
|
||||
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
HideDialog();
|
||||
}
|
||||
|
||||
@@ -118,9 +121,9 @@ namespace AibisDream
|
||||
EnumEventSystem.Global.Send(DialogEventEnum.LineEnd);
|
||||
var next = _nextStep;
|
||||
_nextStep = null;
|
||||
|
||||
|
||||
_bubbleDict[_curRole].Hide();
|
||||
|
||||
|
||||
next.Invoke();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user