From 688b4b29fc97ccfafd9bb310a645dc5b453932f1 Mon Sep 17 00:00:00 2001 From: yangbear Date: Sat, 11 Jul 2026 05:21:23 +0800 Subject: [PATCH] Fix Shose blinking immediately at start by adding OnDisable hook and correctly disabling the script before activating the object --- Assets/Scripts/Interaction/ShoseClickHandler.cs | 6 ++++++ Assets/Scripts/UI/PageController.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Interaction/ShoseClickHandler.cs b/Assets/Scripts/Interaction/ShoseClickHandler.cs index 1966d69..875765b 100644 --- a/Assets/Scripts/Interaction/ShoseClickHandler.cs +++ b/Assets/Scripts/Interaction/ShoseClickHandler.cs @@ -14,6 +14,12 @@ public class ShoseClickHandler : MonoBehaviour private Quaternion _initialRotation; private bool _hasRecordedInitialTransform = false; + void OnDisable() + { + StopAllCoroutines(); + if (_outlineMesh != null) _outlineMesh.enabled = false; + } + void OnEnable() { var mf = GetComponent(); diff --git a/Assets/Scripts/UI/PageController.cs b/Assets/Scripts/UI/PageController.cs index 8c7fb3d..d509b28 100644 --- a/Assets/Scripts/UI/PageController.cs +++ b/Assets/Scripts/UI/PageController.cs @@ -455,8 +455,8 @@ public class PageController : MonoBehaviour h.nextObject = chanraotuibu; } // 确保一开始鞋子模型可见,但不闪烁且不可点击 - shose.SetActive(true); h.enabled = false; + shose.SetActive(true); } if (point2 != null)