From 3ebe010dfdbf951adcb2ec66e297762ad5f6db09 Mon Sep 17 00:00:00 2001 From: yangbear Date: Tue, 30 Jun 2026 14:47:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Previous/Next=E8=B5=B0=E5=AF=B9woman?= =?UTF-8?q?=E6=AD=A5=E8=BF=9B=20+=20=E5=BC=80=E5=9C=BA=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=87=8D=E5=A4=8D=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PreviousStep/NextStep: woman自由步进优先于Config路径 - UpdateTouchVisibility: 修正索引 i==step (之前错误地用step-1) - PlayOpeningFlow: 每次调用前重置man/man2/摄像机状态,支持返回重来 - PageController: 移除InitializeFromGameManager调用,不再覆盖woman步进 --- .../Animation/OpeningFlowController.cs | 18 ++++++++++++++++++ Assets/Scripts/Core/StepManager.cs | 19 ++++++++++++++++--- Assets/Scripts/UI/PageController.cs | 4 ---- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Assets/Scripts/Animation/OpeningFlowController.cs b/Assets/Scripts/Animation/OpeningFlowController.cs index a88c638..6d239d8 100644 --- a/Assets/Scripts/Animation/OpeningFlowController.cs +++ b/Assets/Scripts/Animation/OpeningFlowController.cs @@ -87,6 +87,24 @@ public class OpeningFlowController : MonoBehaviour public void PlayOpeningFlow(System.Action onComplete) { Debug.Log("[OpeningFlow] PlayOpeningFlow() 被调用"); + + // 每次播放前重置场景(支持重复播放) + if (_manAnimator != null) + { + _manAnimator.gameObject.SetActive(true); + _manAnimator.SetBool("IsStart", false); + _manAnimator.SetBool("IsFull", false); + } + if (_man2Object != null) _man2Object.SetActive(true); + if (_womanObject != null) _womanObject.SetActive(false); + if (_manInjuryObject != null) _manInjuryObject.SetActive(false); + if (_blackScreenPanel != null) _blackScreenPanel.SetActive(false); + + var mainCam = Camera.main; + if (mainCam != null) mainCam.enabled = true; + var cam2 = GameObject.Find("camera2"); + if (cam2 != null) { var c = cam2.GetComponent(); if (c != null) c.enabled = false; } + StartCoroutine(RunOpeningFlow(onComplete)); } diff --git a/Assets/Scripts/Core/StepManager.cs b/Assets/Scripts/Core/StepManager.cs index 01529a1..a36e5c3 100644 --- a/Assets/Scripts/Core/StepManager.cs +++ b/Assets/Scripts/Core/StepManager.cs @@ -124,14 +124,18 @@ public class StepManager : MonoBehaviour public void NextStep() { - if (_activeSteps == null) { WomanStepNext(); return; } + // Woman 自由步进优先 + if (_womanObject != null && _womanPositions != null) { WomanStepNext(); return; } + if (_activeSteps == null) return; if (_currentStepIndex >= _activeSteps.Length - 1) { CompleteExperiment(); return; } GoToStep(_currentStepIndex + 1); } public void PreviousStep() { - if (_activeSteps == null) { WomanStepPrevious(); return; } + // Woman 自由步进优先 + if (_womanObject != null && _womanPositions != null) { WomanStepPrevious(); return; } + if (_activeSteps == null) return; if (_currentStepIndex <= 0) return; GoToStep(_currentStepIndex - 1); } @@ -221,7 +225,16 @@ public class StepManager : MonoBehaviour private void UpdateTouchVisibility(int step) { if (_touchPoints == null) return; - for (int i = 0; i < _touchPoints.Length; i++) _touchPoints[i].SetActive(i == step - 1); + for (int i = 0; i < _touchPoints.Length; i++) + { + bool show = (i == step); + _touchPoints[i].SetActive(show); + if (show) + { + var mr = _touchPoints[i].GetComponent(); + if (mr != null) mr.enabled = true; + } + } } diff --git a/Assets/Scripts/UI/PageController.cs b/Assets/Scripts/UI/PageController.cs index 9d99608..96dbb5e 100644 --- a/Assets/Scripts/UI/PageController.cs +++ b/Assets/Scripts/UI/PageController.cs @@ -309,8 +309,6 @@ public class PageController : MonoBehaviour var stepManager = FindObjectOfType(); if (stepManager != null) { - stepManager.InitializeFromGameManager(); - Debug.Log("PageController: StepManager.InitializeFromGameManager() 已调用"); } else { @@ -326,8 +324,6 @@ public class PageController : MonoBehaviour var stepManager = FindObjectOfType(); if (stepManager != null) { - stepManager.InitializeFromGameManager(); - Debug.Log("PageController: StepManager.InitializeFromGameManager() 已调用"); } } }