VideoPlayer使用的比较少 一般都用AVpro 但有些视屏比较特殊 例如带透明通道的MP4 需要吧背景黑色过滤掉 就用到了VideoPlayer 播放完成事件
public VideoPlayer vp;
void Start()
{
vp.loopPointReached += EndWithVideoPlay;
}
public void EndWithVideoPlay(VideoPlayer source)
{
RemoveTargetframe();
//TODO播放完成后事件
}
/// <summary>
///texture 清除上一帧渲染
/// </summary>
private void RemoveTargetframe()
{
vp.targetTexture.Release();
vp.targetTexture.MarkRestoreExpected();
}