2015/07/07//////////
by xbw////////////////
Environment Unity 4.6.1///
Playing a cool animation before the game is not very attractive to add;
Unity supports video formats with Mov. Mpg. Mpeg. MP4. Avi. Asf.
We dragged the needed video directly into project,
The next is the code;
Using unityengine;using System.collections;public class Cameramoveplay:monobehaviour {public movietexture Movtexture; Public Audiosource movaudio;void Start () { movtexture.loop = False;//ture video loop play} void Ongui () { GUI . Drawtexture (New Rect (0,0, screen.width,screen.height), Movtexture,scalemode.stretchtofill); if (Guilayout.button ("Play/continue")) { if (!movtexture.isplaying) { movtexture.play (); Movaudio.play (); } } if (Guilayout.button ("pause")) { movtexture.pause (); Movaudio.pause (); } if (Guilayout.button ("Stop")) { movtexture.stop (); Movaudio.stop (); Application.loadlevel ("Second");}}}
The part of the note is the sound,
The last sentence is the scene conversion, see my other articles;;;
Mount this code to the main camera and drag the video onto the movtexture.
That would be good;;;
Students are welcome to exchange and learn from each other
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Unity 3D Cool Opening animation