I want to navigate to a URL after video clip ends. And i searched and got something to start with, but its not working fine for me and am getting errors.
Can anyone help…
Am getting the following error,
Unexpected yield,
Unexpected token Ienumerator…
function Update () {
if (Input.GetButtonDown ("Jump")) {
if (MyVideoTexture.isPlaying) {
MyVideoTexture.Pause();
audio.Pause();
}
else
{
MyVideoTexture.Play();
audio.Play();
// Wait for the clip to finish
StartCoroutine(Wait(MyVideoTexture.duration));
Application.OpenURL ("http://unity3d.com/");
}
}
}
private IEnumerator Wait(float duration)
{
yield return new WaitForSeconds(duration);}