diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index ef01676..715f0ad 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -196,15 +196,19 @@ public class GameManager : MonoBehaviour if (videoControl.IsCanPlayMP4()) { videoControl.PlayMP4(); - if (!videoControl.IsCanPlayMP4())// 播放到了最后一个视频, 自动播放End动画 - { - brainTrans.gameObject.SetActive(false); - videoControl.PlayEndVideo(); - videoControl.OnPlayFinished += ResetToGameStart; - } + videoControl.OnPlayFinished += TryToPlayEndAnim; } } } + private void TryToPlayEndAnim() + { + videoControl.OnPlayFinished -= TryToPlayEndAnim; + if (videoControl.IsCanPlayMP4())// 播放到了最后一个视频, 自动播放End动画 + return; + brainTrans.gameObject.SetActive(false); + videoControl.PlayEndVideo(); + videoControl.OnPlayFinished += ResetToGameStart; + } private void ResetToGameStart() { videoControl.OnPlayFinished -= ResetToGameStart;