Right now I have the following simple script to play a Movietexture on a Plane. I want to be able to detect the last frame so I can trigger a countdown script in another Text component. What changes do I need to make?
using UnityEngine;
using System.Collections;
[RequireComponent (typeof (AudioSource))]
public class VideController : MonoBehaviour {
// Use this for initialization
void Start () {
Screen.SetResolution (768, 1024, false, 60);
MovieTexture movie = renderer.material.mainTexture as MovieTexture;
audio.clip = movie.audioClip;
audio.Play ();
movie.Play ();
}
// Update is called once per frame
void Update () {
}
}