From 7519b37ee669f08199296fe9bb3e1dc25d130a14 Mon Sep 17 00:00:00 2001 From: yangbear Date: Tue, 30 Jun 2026 15:09:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A8=A1=E5=9E=8B=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E6=81=A2=E5=A4=8D=20-=20man=20Animator?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=20+=20touchPoint=E9=97=AA=E7=83=81=E9=87=8D?= =?UTF-8?q?=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PlayOpeningFlow/ReturnToHome: 增加 _manAnimator.Play("manIdle") 强制重置动画状态 - TouchPositionHandler: 新增 OnEnable() 重新激活时自动重启闪烁协程+启用MeshRenderer - 解决返回重来后 man 还停在 manfull、touchPoint 不再闪烁的问题 --- Assets/Scripts/Animation/OpeningFlowController.cs | 10 +++++++--- Assets/Scripts/Interaction/TouchPositionHandler.cs | 9 +++++++++ Assets/Scripts/UI/PageController.cs | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Animation/OpeningFlowController.cs b/Assets/Scripts/Animation/OpeningFlowController.cs index c2166ea..bd0dcef 100644 --- a/Assets/Scripts/Animation/OpeningFlowController.cs +++ b/Assets/Scripts/Animation/OpeningFlowController.cs @@ -88,14 +88,18 @@ public class OpeningFlowController : MonoBehaviour { Debug.Log("[OpeningFlow] PlayOpeningFlow() 被调用"); - // 重置场景(支持重复播放) - if (_manAnimator != null) { _manAnimator.gameObject.SetActive(true); _manAnimator.SetBool("IsStart", false); _manAnimator.SetBool("IsFull", false); } + if (_manAnimator != null) + { + _manAnimator.gameObject.SetActive(true); + _manAnimator.SetBool("IsStart", false); + _manAnimator.SetBool("IsFull", false); + _manAnimator.Play("manIdle", 0, 0f); + } if (_man2Object != null) _man2Object.SetActive(true); if (_womanObject != null) _womanObject.SetActive(false); if (_manInjuryObject != null) _manInjuryObject.SetActive(false); if (_blackScreenPanel != null) _blackScreenPanel.SetActive(false); - // 用名字找主摄像机(Camera.main 在主摄像机关闭后返回 null) var mainCamGo = GameObject.Find("Main Camera"); if (mainCamGo != null) { var c = mainCamGo.GetComponent(); if (c != null) c.enabled = true; } var cam2Go = GameObject.Find("camera2"); diff --git a/Assets/Scripts/Interaction/TouchPositionHandler.cs b/Assets/Scripts/Interaction/TouchPositionHandler.cs index e55af60..f8f5331 100644 --- a/Assets/Scripts/Interaction/TouchPositionHandler.cs +++ b/Assets/Scripts/Interaction/TouchPositionHandler.cs @@ -54,4 +54,13 @@ public class TouchPositionHandler : MonoBehaviour Debug.Log($"[TouchPosition] {name} → {nextTouchObject.name} 显示"); } } + + + private void OnEnable() + { + _meshRenderer = GetComponent(); + if (_meshRenderer != null) _meshRenderer.enabled = true; + StopAllCoroutines(); + StartCoroutine(BlinkMesh()); + } } diff --git a/Assets/Scripts/UI/PageController.cs b/Assets/Scripts/UI/PageController.cs index 7478ce9..620babc 100644 --- a/Assets/Scripts/UI/PageController.cs +++ b/Assets/Scripts/UI/PageController.cs @@ -381,7 +381,7 @@ public class PageController : MonoBehaviour if (cam2Go != null) { var c = cam2Go.GetComponent(); if (c != null) c.enabled = false; } var manAnim = man != null ? man.GetComponent() : null; - if (manAnim != null) { manAnim.SetBool("IsStart", false); manAnim.SetBool("IsFull", false); } + if (manAnim != null) { manAnim.SetBool("IsStart", false); manAnim.SetBool("IsFull", false); manAnim.Play("manIdle", 0, 0f); } ShowPage(Page.Home); }