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() 已调用"); } } }