Unity supports video streaming, that is, you can upload a video and attach it to an animated video object. Basically, the quick time player on your computer can play the video, the supported video formats are as follows:
. Mov,. mpg,. MPEG,. MP4,. Avi,. ASF
The only thing to note is that unity does not play a video automatically. You must add a new row or a number of rows to play the video, the following two Playback modes are provided for the test:
1. the specified worker row is played immediately: function Update () {Renderer. material. maintexture. play ();} 2. custom stream playback: function Update () {If (input. getbuttondown ("jump") {If (Renderer. material. maintexture. isplaying) {Renderer. material. maintexture. pause ();} else {Renderer. material. maintexture. play ();}}}
Usage:
1. Load a video
2. Attach a video to a movie clip (this example uses plane)
3. Add blank JavaScript and upload the program example (Example 1)
4. Add blank JavaScript and upload the program example (Example 2)
5. Attach the notebook to the notebook object
6. Video Playback