Hi,
I’ve managed to use this code to sucessfully load and play a OGV video stored in the Assets\Resources folder.
However I’d like the user to load video from disk at run-time.
I know how to do this for a standard image texture, by using .LoadImage in the Texture2D type (i.e. see [SOLVED] Apply Image to Plane Primitive - Unity Engine - Unity Discussions )
But how to do this with a MovieTexture?
Thanks
A.
public void loadVideo (GameObject container, string video)
{
// Load MovieTexture from Resources Folder
MovieTexture mat = (MovieTexture)Resources.Load(Path.GetFileNameWithoutExtension(video), typeof(MovieTexture));
MeshRenderer ren = container.GetComponent<MeshRenderer>();
ren.material.mainTexture = mat;
mat.Play();
}