fix: 修复对话中仍能与插头交互的问题

This commit is contained in:
2026-04-23 21:25:35 +08:00
parent 72c0dfb746
commit 39b9ed487c
3 changed files with 16 additions and 2 deletions
@@ -106,6 +106,7 @@ namespace AibisDream.FixSystem
private void OnPointerDown(BaseEventData eventData)
{
if (EventSystemEx.Instance.isLocked) return;
if (eventData is PointerEventData { button: PointerEventData.InputButton.Right })
return;
@@ -131,6 +132,11 @@ namespace AibisDream.FixSystem
private void OnPointerUp(BaseEventData eventData)
{
if (EventSystemEx.Instance.isLocked)
{
_isDragging = false;
return;
}
if (eventData is PointerEventData { button: PointerEventData.InputButton.Right })
{
return;
@@ -137,11 +137,14 @@ namespace AibisDream.FixSystem
// ------------------------------ 插头事件 ------------------------------
private void OnInsertSocket(ISocket socket)
{
var isSameSocket = curSocket == socket;
curSocket = socket;
CableRef.SetEndPos(socket.GetSocketPos());
AudioManager.Instance.PlaySfx("event:/FollowInput/plugin");
if (socket is BodyModule bodyModule)
if (!isSameSocket
&& !EventSystemEx.Instance.isLocked
&& socket is BodyModule bodyModule)
{
// 插入模块时触发插入事件
EnumEventSystem.Global.Send(EventEnum.PlugIn);
@@ -157,7 +160,7 @@ namespace AibisDream.FixSystem
AudioManager.Instance.PlaySfx("event:/FollowInput/plugout");
// 如果是模块
if (curSocket is BodyModule)
if (!EventSystemEx.Instance.isLocked && curSocket is BodyModule)
{
EnumEventSystem.Global.Send(EventEnum.PlugOut);
}
@@ -340,6 +340,11 @@ namespace AibisDream.UI
typewriter.StopShowingText();
}
// 打字机被中途打断时补发一次"展示完成"信号,避免监听方(如 LineSyncToken
// 永远停留在 PlayText 状态;与 AddText 完成路径保持一致。
OnTextShown?.Invoke();
OnTextShown = null;
// 同时清除TextAnimator和底层TMP_Text
if (textAnimator != null)
{