Skip to content

Instantly share code, notes, and snippets.

@david-hodgetts
Created June 18, 2012 08:19
Show Gist options
  • Save david-hodgetts/2947458 to your computer and use it in GitHub Desktop.
Save david-hodgetts/2947458 to your computer and use it in GitHub Desktop.
adaptation of function SetVideoTexture to work with unity 3.4
function SetVideoTexture(resourceName:String)
{
Debug.Log("changing video texture " + resourceName);
movieTexture = Resources.Load(resourceName) as MovieTexture;
if (movieTexture)
{
movieTexture.Play();
movieTexture.loop = true;
audio.clip = movieTexture.audioClip;
audio.Play();
}
Resources.UnloadUnusedAssets();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment