Fixed Bug Jump Last Video

main
Yogi 2024-12-04 18:32:30 +08:00
parent 11e215f7da
commit 246882573f
1 changed files with 10 additions and 6 deletions

View File

@ -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;