From 0dc10017239cfc3346f873cfed9935f70a8a4aae Mon Sep 17 00:00:00 2001 From: Ding Yuntian <1491671119@qq.com> Date: Sat, 18 Jul 2026 17:28:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20BodyModule=E5=8F=AF=E8=83=BD=E7=9A=84?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FixSystemNew/BodyModule/BodyModuleSystem.cs | 6 +++--- .../Screen System/Core/RepairSystemManager.cs | 16 +++++++--------- Assets/Scripts/Game Loop/GameManager.cs | 6 +++--- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Assets/Scripts/FixSystemNew/BodyModule/BodyModuleSystem.cs b/Assets/Scripts/FixSystemNew/BodyModule/BodyModuleSystem.cs index a42413db1..2a236fa8c 100644 --- a/Assets/Scripts/FixSystemNew/BodyModule/BodyModuleSystem.cs +++ b/Assets/Scripts/FixSystemNew/BodyModule/BodyModuleSystem.cs @@ -67,9 +67,6 @@ namespace AibisDream.FixSystem } FixSystemCenter.SystemDic.Register(this); - - // 注册到维修系统管理器 - RepairSystemManager.Register(this); } /// 捕获插线模块持久状态(分组 + UF + Chip + 高亮/报警)。 @@ -357,6 +354,9 @@ namespace AibisDream.FixSystem private void Start() { + // RepairSystemManager 的 Awake 已在所有场景对象的 Start 前完成。 + RepairSystemManager.Register(this); + if (_headModuleGroup != null) { _headModuleOriginalPos = _headModuleGroup.transform.localPosition; diff --git a/Assets/Scripts/FixSystemNew/Screen System/Core/RepairSystemManager.cs b/Assets/Scripts/FixSystemNew/Screen System/Core/RepairSystemManager.cs index 36e0ba7b6..d49dd776f 100644 --- a/Assets/Scripts/FixSystemNew/Screen System/Core/RepairSystemManager.cs +++ b/Assets/Scripts/FixSystemNew/Screen System/Core/RepairSystemManager.cs @@ -43,11 +43,6 @@ namespace AibisDream.FixSystem private Sequence _activeScaleTween; - private void OnDisable() - { - _registeredSystems.Clear(); - } - #region 系统注册 /// @@ -61,6 +56,12 @@ namespace AibisDream.FixSystem return; } + if (Instance == null) + { + Debug.LogError($"[RepairSystemManager] 注册失败:管理器尚未初始化", mb); + return; + } + var type = typeof(T); var system = new RegisteredSystem { @@ -71,10 +72,7 @@ namespace AibisDream.FixSystem Offset = Vector3.zero }; - if (Instance != null) - { - Instance._registeredSystems[type] = system; - } + Instance._registeredSystems[type] = system; Debug.Log($"[RepairSystemManager] 注册系统: {type.Name}"); } diff --git a/Assets/Scripts/Game Loop/GameManager.cs b/Assets/Scripts/Game Loop/GameManager.cs index 9127e1369..705519b0a 100644 --- a/Assets/Scripts/Game Loop/GameManager.cs +++ b/Assets/Scripts/Game Loop/GameManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using AibisDream.FixSystem; @@ -88,8 +88,7 @@ namespace AibisDream return false; } - if (_session.Phase != GameSessionPhase.MainMenu - || !TryAcquireCommand(SessionCommandKind.Start)) + if (!TryAcquireCommand(SessionCommandKind.Start)) { return false; } @@ -306,6 +305,7 @@ namespace AibisDream { try { + // 设置当前状态 _session.ResetRuntimeState(); if (!TrySetPhase(GameSessionPhase.Starting)) {