PROGRAMING📚/🔖Unity3D
[유니티 Unity] 비디오 영상 끝나는 시간 찾기
__윤하루__
2022. 10. 18. 11:36
[Header("Video")]
public VideoPlayer ExplainVideo_vp;
public RenderTexture ExplainRTexture;
public void ExplainVideoFinishTime()
{
StartCoroutine(_ExplainVideoFinishTime());
}
IEnumerator _ExplainVideoFinishTime()
{
while (true)
{
long playerCurrentFrame = ExplainVideo_vp.GetComponent<VideoPlayer>().frame;
long playerFrameCount = Convert.ToInt64(ExplainVideo_vp.GetComponent<VideoPlayer>().frameCount);
if (playerCurrentFrame < playerFrameCount - 10)
{
// print("VIDEO IS PLAYING");
}
else
{
// print("VIDEO IS OVER");
yield return new WaitForSeconds(1f);
DialogManager.instance.Dialog_nextBtn.gameObject.SetActive(true);
SoundManager.Instance.PlayBGM("Bokdungi_Main");
break;
}
yield return null;
}
}