跑通!并且可以八倍速跑通!

This commit is contained in:
2025-07-15 16:05:13 +08:00
parent 2a18f7dc8b
commit 18f52c317e
28 changed files with 4519 additions and 4399 deletions
@@ -87,10 +87,14 @@ namespace AibisDream.FixSystem
public void ShowLine(string dialogLine, CharacterVo character, Action nextStep, string lineId, bool isAutoSkip = false)
{
Debug.Log($"[ScreenSystem] ShowLine - 原始文本: '{dialogLine}'");
if (string.IsNullOrWhiteSpace(dialogLine))
{
dialogLine = " ";
dialogLine = " ";
// Debug.Log("[ScreenSystem] ShowLine - 空文本被替换为空格");
}
ShowTitle(character.GetActorName());
// 生成新文本组件
var textItem = Instantiate(_textItemPrefab, textRoot);
@@ -103,20 +107,29 @@ namespace AibisDream.FixSystem
Destroy(_lineQueue.Dequeue().gameObject);
}
_lineQueue.Enqueue(textItemTypewriter);
// 播放文本
textItemTypewriter.ShowText(dialogLine);
textItemTypewriter.onTextShowed.AddListener(() => AfterLineShown(textItemTypewriter, nextStep));
// 强制更新布局
LayoutRebuilder.ForceRebuildLayoutImmediate(textRoot);
Debug.Log($"[ScreenSystem] ShowLine - 文本播放开始,nextStep是否为null: {nextStep == null}");
}
private void AfterLineShown(TypewriterByCharacter typewriter, Action nextStop)
{
Debug.Log("[ScreenSystem] AfterLineShown - 文本显示完成");
Debug.Log($"[ScreenSystem] AfterLineShown - nextStop是否为null: {nextStop == null}");
EnumEventSystem.Global.Send(DialogEventEnum.LineShown);
ActionKit.Delay(0.3f, () =>
ActionKit.Delay(0.1f, () =>
{
Debug.Log("[ScreenSystem] AfterLineShown - 延迟结束,调用回调");
EnumEventSystem.Global.Send(DialogEventEnum.LineEnd);
nextStop.Invoke();
Debug.Log("[ScreenSystem] AfterLineShown - 回调调用完成");
}).StartGlobal();
typewriter.onTextShowed.RemoveAllListeners();
}