To play a sequence of videos using scripting, follow these steps:
- Create a new Unity 3D project.
- Import the provided 54321TestVideo.mov file, and perhaps a second video clip, so that we can have a sequence of two different videos to test (although you can run the same one twice if you wish).
- In the Project window, create a new Render Texture asset file named myRenderTexture by going to Create | Render Texture.
- Add a UI RawImage to the scene by going to Create | UI | Raw Image.
- Select the UI RawImage in the Hierarchy window and assign its Raw Image (Script) Texture property to the myRenderTexture asset file.
- In the Project window, create a new Material asset file named m_video. For this material, in the Inspector window, set its Albedo Texture property to myRenderTexture (drag it from the Project ...