Can someone explain in detail how to make a video file to play in the begining of the game and after it finishes playing it will load the next level which is probably the Main Menu?
This forum posting should help you get started: video intro
From the documentation: MovieTexture
Another forum posting that should help: Loading Level After Video Played
If you're using Application.CanStreamedLevelBeLoaded you need to be careful to have the scene you're checking (your main scene) also available in the build settings (otherwise this will always fail).
The solution with checking if the video is still playing should work fine ;-)
So, to sum it up (and add some detail):
- In your "trailer scene"; have a game object with a script attached that starts playing the video in the Start() method
- After the video has started, check whether it is still playing - when it's no longer playing, use Application.LoadLevel to load your main menu
- Display the video using UnityGUI (as in the above mentioned forum posting)
That should be it ;-)
Other relevant postings that might be helpful: Playing videos in the GUI, How do I play a full screen video? ... for any iPhone users that run into this question - on Unity iPhone, things work a little differently: how integrate video before menu in unity iphone game
I know this was asked in 2010, but for anyone searching in 2015, you can use :
Handheld.PlayFullScreenMovie() to play a video file on mobile.