视点切换

usingSystem.Collections.Generic;usingUnityEngine;usingUnityEngine.Video;usingUnityEngine.UI;publicclassSwitchVideo:MonoBehaviour{publicVideoPlayervideoPlayer;publicAudioSourceaudioSource;publicList<VideoClip>videos=newList<VideoClip>();publicintindex=0;publicImagefadeImage;// Use this for initializationvoidStart(){videoPlayer.clip=videos[index];videoPlayer.Play();}// Update is called once per framevoidUpdate(){}publicvoidPreviousVideo(){if(index==0)index=videos.Count;index=index-1;fadeImage.GetComponent<FadeAlpha>().Start();videoPlayer.clip=videos[index];videoPlayer.Play();}publicvoidNextVideo(){if(index==videos.Count-1)index=-1;index=index+1;fadeImage.GetComponent<FadeAlpha>().Start();videoPlayer.clip=videos[index];videoPlayer.Play();}}