问题修复

1. CenterText效果异常修复
2. 部分气泡宽度不合预期修复
3. 删除切割日志
This commit is contained in:
2026-01-03 17:40:11 +08:00
parent c6bbf09175
commit 24d23b29d1
17 changed files with 2483 additions and 2256 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+9 -13
View File
@@ -463,19 +463,15 @@ MonoBehaviour:
m_PostInfinity: 2
m_RotationOrder: 4
_filter:
- 0.0048309183
- 0.016401261
- 0.04532712
- 0.08293076
- 0.12053438
- 0.14946026
- 0.1610306
- 0.14946026
- 0.12053438
- 0.08293076
- 0.04532712
- 0.016401261
- 0.0048309183
- 0.007228916
- 0.043749984
- 0.12409639
- 0.20444278
- 0.24096388
- 0.20444278
- 0.12409639
- 0.043749984
- 0.007228916
--- !u!114 &-6086986437317696584
MonoBehaviour:
m_ObjectHideFlags: 3
@@ -10,6 +10,8 @@ position: 250,-26
<<show_actor 地铁医生>>
<<show_actor 地铁火山>>
<<wait 1.5>> // 等待状态机加载
<<jump 地铁ver3>>
===
@@ -4,7 +4,7 @@ position: 250,-2611
---
<<set_global_param Vol_general 0>>
<<set_global_param dream1Stage 0>>
你完成了今天的工作。<br>夜深了… #line:06f029d
<i>你完成了今天的工作。<br>夜深了…</i> #line:06f029d
<<hide_dialog>>
<<declare $started=false>>
@@ -112,9 +112,9 @@ position: 250,-2611
<i>走廊空荡荡的,时不时传来一些遥远的嬉闹声。</i> #line:03a2b9c
<i>一阵风掠过,窗户在窗框上振动,发出轻轻的铛铛声。</i> #line:02d8b46
<i>风停了。</i> #line:093de56
->花<<if $gameStage>0>>
<i>一盆鲜黄的、叫不出名字的花儿在阳光下轻轻摇动,鲜得有些不自然。</i>
<i>你靠近仔细辨认。这似乎是一盆假花。</i>
->花<<if $gameStage>0>> #line:000df9d
<i>一盆鲜黄的、叫不出名字的花儿在阳光下轻轻摇动,鲜得有些不自然。</i> #line:0de7dc9
<i>你靠近仔细辨认。这似乎是一盆假花。</i> #line:00ea002
->趴回去再睡会 #line:0028a19
me: …… #line:00ab4f3
<<hide_obj>>
@@ -181,7 +181,7 @@ position: 250,-2611
<i>女孩正在用水彩笔在窗户上涂抹颜色,绿色的玻璃被涂成了大片的蓝色。看到你靠近,她不好意思地停下了笔。</i> #line:0043186
<<elseif $gameStage==1>>
<<show_obj "D1S佩佩2">>
<i>女孩正专注地向天空中添加红色,没有注意到你的靠近。</i>
<i>女孩正专注地向天空中添加红色,没有注意到你的靠近。</i> #line:0f8d451
<<else>>
<<show_obj "D1S佩佩3">>
<i>女孩正专注地向天空中添加红色,没有注意到你的靠近。</i> #line:0d39c58
@@ -235,7 +235,6 @@ position: 250,-2611
<i>看起来是一个很普通小镇,远处是层层叠叠小楼。你有一阵熟悉的感觉,好像其中一幢就是你的家。</i> #line:0304d72
<i>阳光照在你身上,暖暖的。</i> #line:0650718
<<show_obj "D1S走廊-小镇">>
<<endif>>
<<jump 走廊>>
===
@@ -267,7 +266,7 @@ position: 250,-2611
<i>你站在教学楼的楼顶,视野开阔。阳光照在头顶有些发烫,风也暖暖的。天文台的环形走廊高高的,阿灿正靠在上面发呆。</i> #line:00681be
<<elseif $gameStage < 3>>
<<show_obj "D1S天台2">>
<i>你站在教学楼的楼顶,视野开阔。空气中似乎有种熟悉的令人昏昏沉沉的气味……</i>
<i>你站在教学楼的楼顶,视野开阔。空气中似乎有种熟悉的令人昏昏沉沉的气味……</i> #line:048cd88
<<else>>
<<show_obj "D1S天台3">>
<i>你站在教学楼的楼顶,视野开阔,天蓝蓝的,风也有点儿冷了。你感觉好像有人在喊你。</i> #line:0f4be5a
+56 -20
View File
@@ -4721,7 +4721,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
widthEstimation: {fileID: 1318260399}
centerBubble: {fileID: 1403558896}
--- !u!1 &246580517
GameObject:
m_ObjectHideFlags: 0
@@ -21300,14 +21299,13 @@ GameObject:
m_Component:
- component: {fileID: 1403558893}
- component: {fileID: 1403558895}
- component: {fileID: 1403558896}
m_Layer: 5
m_Name: Center Text
m_Name: Box
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1403558893
RectTransform:
m_ObjectHideFlags: 0
@@ -21321,12 +21319,12 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 27659198}
m_Father: {fileID: 1829169896}
m_Father: {fileID: 1960544481}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1820.0001, y: 980.2295}
m_SizeDelta: {x: 3640.0002, y: 1960.2295}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1403558895
CanvasRenderer:
@@ -21336,19 +21334,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1403558892}
m_CullTransparentMesh: 1
--- !u!114 &1403558896
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1403558892}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67e53e476f874efd9d847b50dc16d6c8, type: 3}
m_Name:
m_EditorClassIdentifier:
dialogText: {fileID: 27659199}
--- !u!1 &1411435708
GameObject:
m_ObjectHideFlags: 0
@@ -25841,9 +25826,9 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1318260398}
- {fileID: 1403558893}
- {fileID: 238296903}
- {fileID: 1020696478}
- {fileID: 1960544481}
m_Father: {fileID: 1604842429}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@@ -26915,6 +26900,57 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1956227899}
m_CullTransparentMesh: 1
--- !u!1 &1960544480
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1960544481}
- component: {fileID: 1960544482}
m_Layer: 5
m_Name: Center Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1960544481
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1960544480}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1403558893}
m_Father: {fileID: 1829169896}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1960544482
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1960544480}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6932a4fdc050a8d41aff602e455e4353, type: 3}
m_Name:
m_EditorClassIdentifier:
content: {fileID: 27659199}
box: {fileID: 1403558892}
--- !u!1 &1960600461
GameObject:
m_ObjectHideFlags: 0
+23 -3
View File
@@ -16,6 +16,12 @@ namespace AibisDream
public override void RunLine(LocalizedLine dialogueLine, Action onDialogueLineFinished)
{
LineSyncToken lineSyncEvent;
if (dialogueLine.TextID.Contains("第一章"))
{
Debug.Log($"第一章: {dialogueLine.GetCharacterVo().dialogViewType}");
}
if (dialogueLine.GetCharacterVo().dialogViewType == DialogViewType.Screen)
{
// 自动推进视图
@@ -43,7 +49,7 @@ namespace AibisDream
Debug.LogWarning($"未注册的视图类型: {dialogueLine.GetCharacterVo().dialogViewType}");
}
}
else
else if (dialogueLine.GetCharacterVo().dialogViewType == DialogViewType.Default)
{
// 手动推进视图
lineSyncEvent = LineSyncToken.CreateDefault(dialogueLine, onDialogueLineFinished);
@@ -57,8 +63,22 @@ namespace AibisDream
{
Debug.LogWarning($"未注册的视图类型: {defaultViewType}");
}
}
}
else
{
// 指定了视图类型
lineSyncEvent = LineSyncToken.CreateDefault(dialogueLine, onDialogueLineFinished);
if (_screenViewDict.TryGetValue(dialogueLine.GetCharacterVo().dialogViewType, out var view))
{
DialogController.Instance.lineSyncToken = lineSyncEvent;
view.RunLine(lineSyncEvent);
}
else
{
Debug.LogWarning($"未注册的视图类型: {dialogueLine.GetCharacterVo().dialogViewType}");
}
}
// 最后交给推进处理
advanceInput.RunLine(lineSyncEvent);
}
@@ -654,7 +654,6 @@ public class GearFollower : MonoBehaviour
{
// 检查是否形成了连续的切割路径
bool hasContinuousCut = CheckContinuousCut();
Debug.Log($"连续切割检查: {hasContinuousCut}, 已切割点数: {cutEdgeIndices.Count}, 总点数: {edgePoints.Count}");
if (hasContinuousCut)
{
@@ -716,7 +715,6 @@ public class GearFollower : MonoBehaviour
// 计算连续切割点的比例
float continuousRatio = (float)maxContinuousCount / totalPoints;
Debug.Log($"最大连续切割点数: {maxContinuousCount}, 总点数: {totalPoints}, 比例: {continuousRatio * 100}%");
// 如果连续切割点的数量超过总点数的70%,认为形成了有效的切割路径
return continuousRatio >= 0.7f;
@@ -314,8 +314,6 @@ namespace AibisDream.FixSystem
}
}
Debug.Log($"更新灯光状态: {currentState}, 目标颜色: {targetColor}, 呼吸速度: {breathingSpeed}");
// 更新呼吸灯
if (breathingLight != null)
{
+1 -2
View File
@@ -84,7 +84,6 @@ namespace AibisDream.Kit
{
Aside,
Player,
MainActor,
Center
MainActor
}
}
@@ -157,6 +157,7 @@ namespace AibisDream
{
if (_bubbleGroup == null)
{
Debug.LogWarning("BubbleGroup为空");
return;
}
@@ -32,7 +32,7 @@ namespace AibisDream
var bubble = _pool.Allocate();
bubble.OnDisposed += o => _pool.Recycle(o);
bubble.LoadConfig(data);
bubble.LoadConfig(data, _bubbleGroup);
bubble.Hide();
return bubble;
@@ -14,7 +14,6 @@ namespace AibisDream
public class BubbleGroup : MonoBehaviour, ILineView
{
[SerializeField] private TMP_Text widthEstimation;
[SerializeField] private CenterBubble centerBubble;
private Dictionary<ActorRole, Bubble[]> _bubbleDict = new();
private BubbleFactory _bubbleFactory;
@@ -24,7 +23,7 @@ namespace AibisDream
private void Start()
{
_bubbleFactory = new BubbleFactory(transform);
_bubbleFactory = new BubbleFactory(this);
EnumEventSystem.Global.Register(DialogEventEnum.OptionShow, OnOptionShow);
DialogUIManager.Instance.RegisterScreenView(DialogViewType.StandardBubble, this);
}
@@ -118,8 +117,6 @@ namespace AibisDream
{
textBubble.Hide();
}
centerBubble.Hide();
}
private void HideDialog(IBubble activeBubble)
@@ -131,21 +128,10 @@ namespace AibisDream
textBubble.Hide();
}
}
if (activeBubble != (IBubble)centerBubble)
{
centerBubble.Hide();
}
}
private bool TryGetBubble(ActorRole role, int idx, out IBubble bubble)
{
if (role == ActorRole.Center)
{
bubble = centerBubble;
return true;
}
if (_bubbleDict.TryGetValue(role, out var bubbles))
{
bubble = bubbles.FirstOrDefault(item => item.Idx == idx);
@@ -1,62 +0,0 @@
using System;
using AibisDream.Kit;
using Febucci.UI;
using UnityEngine;
namespace AibisDream
{
public class CenterBubble : MonoBehaviour, IBubble
{
[SerializeField] private TypewriterByCharacter dialogText;
public ActorRole Role => ActorRole.Center;
public int Idx => 0;
public event Action OnLineShown;
private void OnEnable()
{
dialogText.onTextShowed.AddListener(InvokeLineShown);
}
private void OnDisable()
{
dialogText.onTextShowed.RemoveAllListeners();
}
private void InvokeLineShown()
{
OnLineShown?.Invoke();
OnLineShown = null;
}
public void ShowActorName(CharacterVo characterVo)
{
// 不显示名称
}
public void ShowLine(string line)
{
dialogText.TextAnimator.SetText("");
gameObject.SetActive(true);
dialogText.ShowText(line);
}
public bool SkipLine()
{
if (dialogText.isShowingText)
{
dialogText.SkipTypewriter();
return true;
}
else
{
return false;
}
}
public void Hide()
{
gameObject.SetActive(false);
}
}
}
@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 67e53e476f874efd9d847b50dc16d6c8
timeCreated: 1761206826
+112
View File
@@ -0,0 +1,112 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Febucci.UI.Core;
using UnityEngine;
using AibisDream.Utility;
using AibisDream.Framework;
namespace AibisDream
{
public class CenterText : MonoBehaviour, ILineView
{
[SerializeField] private TypewriterCore content;
[SerializeField] private GameObject box;
private CancellationTokenSource _autoHideToken;
private event Action OnTextShowed;
// ---------------------------- 显示逻辑 ----------------------------
public void RunLine(LineSyncToken syncToken)
{
// 先中断结束事件
_autoHideToken?.Cancel();
_autoHideToken = null;
// 注册事件
OnTextShowed += syncToken.TextShown;
syncToken.SkipTextAnima += () => content.SkipTypewriter();
syncToken.OnAdvance += AfterAdvance;
// 播放文字
content.TextAnimator.SetText(string.Empty);
box.SetActive(true);
content.ShowText(syncToken.lineInfo.lineText);
syncToken.TextStart();
}
private async void AfterAdvance()
{
_autoHideToken = new CancellationTokenSource();
try
{
await Task.Delay(ConstRef.AutoHideDelay, _autoHideToken.Token);
HideDialog();
}
catch (TaskCanceledException)
{
// 忽略取消
}
}
public void HideDialog()
{
box.SetActive(false);
}
// ---------------------------- 生命周期 ----------------------------
private void Awake()
{
box.SetActive(false);
}
private void Start()
{
DialogUIManager.Instance.RegisterScreenView(DialogViewType.CenterText, this);
RegisterEvents();
}
private void OnDestroy()
{
DialogUIManager.Instance.UnRegisterScreenView(DialogViewType.CenterText);
UnregisterEvents();
OnTextShowed = null;
}
private void RegisterEvents()
{
// 全局事件
EnumEventSystem.Global.Register(DialogEventEnum.OptionShow, OnOptionShow);
// 文本事件
content.onTextShowed.AddListener(TextShowed);
}
private void UnregisterEvents()
{
// 全局事件
EnumEventSystem.Global.UnRegister(DialogEventEnum.OptionShow, OnOptionShow);
// 文本事件
content.onTextShowed.RemoveListener(TextShowed);
}
private void TextShowed()
{
OnTextShowed?.Invoke();
OnTextShowed = null;
}
private void OnOptionShow()
{
_autoHideToken?.Cancel();
_autoHideToken = null;
HideDialog();
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6932a4fdc050a8d41aff602e455e4353
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: