public void Init() { Debug.Log("视频初始化"); if(videoPlay==null) { videoPlay = gameObject.transform.GetComponentInChildren<VideoPlayer>(); StartCoroutine(VideoCallBack(videoPlay,AA)); } } public void AA() { Debug.Log("视频播放完毕"); } private IEnumerator VideoCallBack(VideoPlayer VideoObject, Action action)//方法可以传递参数 { Debug.Log(VideoObject.isPlaying); while (VideoObject.isPlaying) { yield return new WaitForFixedUpdate(); //跟FixedUpdate 一样根据固定帧 更新 } action(); }
【Unity】判断视频是否播放完毕
最新推荐文章于 2024-06-16 18:01:49 发布