Improve exam flow and WebGL build

This commit is contained in:
yangbear
2026-07-17 05:42:52 +08:00
parent 9b4690d396
commit bd76dfd9ec
34 changed files with 89955 additions and 8244 deletions
@@ -115,12 +115,14 @@ public class OpeningFlowController : MonoBehaviour
if (_man2Object != null) _man2Object.SetActive(false);
if (_womanObject != null) _womanObject.SetActive(true);
if (_manInjuryObject != null) { _manInjuryObject.SetActive(true); DeactivateManInjuryChildren(); }
RevealShoseBeforeFadeOut();
SwitchToCamera2();
onComplete?.Invoke();
return;
}
if (_manAnimator != null) { _manAnimator.gameObject.SetActive(true); _manAnimator.SetBool("IsStart", false); _manAnimator.SetBool("IsFull", false); _manAnimator.Play("manIdle", 0, 0f); }
if (_man2Animator != null) _man2Animator.speed = 1f;
if (_man2Object != null) _man2Object.SetActive(true);
if (_womanObject != null) _womanObject.SetActive(false);
if (_manInjuryObject != null) _manInjuryObject.SetActive(false);
@@ -154,6 +156,7 @@ public class OpeningFlowController : MonoBehaviour
// Step 3: 摔倒 + manCall 音效
Debug.Log("[OpeningFlow] Step3: manfull 开始");
if (AudioManager.I != null) AudioManager.I.PlayManCallSfx();
if (_man2Animator != null) _man2Animator.speed = 0f;
if (_manAnimator != null) { _manAnimator.Play("manfull", 0, 0f); }
yield return new WaitForSeconds(2.1f);
Debug.Log("[OpeningFlow] manfull 播放完成, 停留 2s");
@@ -166,6 +169,7 @@ public class OpeningFlowController : MonoBehaviour
if (_man2Object != null) { _man2Object.SetActive(false); Debug.Log("[OpeningFlow] man2 已隐藏"); }
if (_womanObject != null) { _womanObject.SetActive(true); Debug.Log("[OpeningFlow] woman 已显示"); }
if (_manInjuryObject != null) { _manInjuryObject.SetActive(true); DeactivateManInjuryChildren(); Debug.Log("[OpeningFlow] manInjury 已显示,子级已清理"); }
RevealShoseBeforeFadeOut();
SwitchToCamera2();
yield return new WaitForSeconds(0.3f);
@@ -228,4 +232,36 @@ public class OpeningFlowController : MonoBehaviour
Debug.Log("[OpeningFlow] manInjury ping/chanrao 已全部隐藏");
}
private void RevealShoseBeforeFadeOut()
{
GameObject shose = FindSceneObject("Shose");
if (shose == null) return;
shose.SetActive(true);
ShoseClickHandler handler = shose.GetComponent<ShoseClickHandler>();
if (handler != null)
{
handler.enabled = false;
handler.ForceHideOutline();
}
Debug.Log("[OpeningFlow] Shose 已在黑幕期间预显示");
}
private GameObject FindSceneObject(string objectName)
{
GameObject found = GameObject.Find(objectName);
if (found != null) return found;
Transform[] all = Resources.FindObjectsOfTypeAll<Transform>();
for (int i = 0; i < all.Length; i++)
{
Transform t = all[i];
if (t != null && t.gameObject.scene.IsValid() && t.name == objectName)
return t.gameObject;
}
return null;
}
}