fix: 模型状态完全恢复 - man Animator重置 + touchPoint闪烁重启

- PlayOpeningFlow/ReturnToHome: 增加 _manAnimator.Play("manIdle") 强制重置动画状态
- TouchPositionHandler: 新增 OnEnable() 重新激活时自动重启闪烁协程+启用MeshRenderer
- 解决返回重来后 man 还停在 manfull、touchPoint 不再闪烁的问题
This commit is contained in:
yangbear
2026-06-30 15:09:31 +08:00
parent 039099e1f6
commit 7519b37ee6
3 changed files with 17 additions and 4 deletions
@@ -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<Camera>(); if (c != null) c.enabled = true; }
var cam2Go = GameObject.Find("camera2");
@@ -54,4 +54,13 @@ public class TouchPositionHandler : MonoBehaviour
Debug.Log($"[TouchPosition] {name} → {nextTouchObject.name} 显示");
}
}
private void OnEnable()
{
_meshRenderer = GetComponent<MeshRenderer>();
if (_meshRenderer != null) _meshRenderer.enabled = true;
StopAllCoroutines();
StartCoroutine(BlinkMesh());
}
}
+1 -1
View File
@@ -381,7 +381,7 @@ public class PageController : MonoBehaviour
if (cam2Go != null) { var c = cam2Go.GetComponent<Camera>(); if (c != null) c.enabled = false; }
var manAnim = man != null ? man.GetComponent<Animator>() : 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);
}