Suddenly, I thought about what it would be like to play a video on a cube object. Today, we finally have time to try it out. Result => succeeded.
The detailed steps are as follows:
Preparation phase:
1. Unity pro edition => genuine edition required (of course, the cracked version is OK, you know ).
2. Install QuickTime player. Must be installed. Otherwise, unity will automatically report an error when importing movie resources.
3. Install the formatting factory software => movie format conversion. Other tools are also OK. Here, the format is converted to mov by default. M after Avi conversion is about 7 m.
======================================
Operations in Unity
1. Drag a movie resource in mov format to the Assets Directory. [Note: it may take one or two minutes, and unity is in the suspended state, which may be the cause of excessive resources.]
2. Create a cube object with a central 3d stereoscopy. Create a light.
3. Drag the imported movie resource to the Cube object. Make sure that the Renderer component exists on the cube object. If not, manually add one.
4. Add an audio source component for the cube object and select the imported movie audio file as the sound source.
5. Add a script to the Cube object. [the script hangs on any object].……
Public class playermovie: monobehaviour
{
Public movietexture; // movie texture
Void start ()
{
This. Renderer. Material. maintexture = movietexture;
Movietexture. Play ();
}
}
6. Return to the unity scenario, drag the movie resource to the movietexture in the script, and set play on awake to start playing. Of course, it can also be controlled through the GUI.
Last one:
Another 3D version: