|
hi i need integrate a video movie introduction before my menu game unity iphone. how is that posible?
(comments are locked)
|
|
Like @Tetrad said, i created a "iPhoneStreamingAssets"-folder in a new unity-project and imported a *.mp4 video with this code:
After that i build and run it on my ipad - but no video playback on the app-start.The movieplayback-control is only 0.5 seconds visible - but no video. Any ideas on that? (i checked my imported video in the inspector with the video-size-format but i cant preview it in the inspector.. is that correctly or does that show that the video file is wrong?) And a second question: Where are the video-files (from the "iPhoneStreamingAssets"-folder) that unity generates in the xcode project? Thanks for any help... So, after working on it, its now working. I only moved the "iPhoneStreamingAsset"-path one folder up where the "Assets" and the "Library"-folders are, then it works.
Jun 28 '10 at 01:13 PM
yosh
to me it worked with
Feb 04 '11 at 09:41 PM
Cawas
just to complement my previous comment, its path was indeed changed: http://answers.unity3d.com/questions/26570/iphoneutilsplaymovie-seems-disabled-in-unity-3.html
Oct 18 '11 at 03:39 PM
Cawas
(comments are locked)
|
|
Assuming that you have Unity iPhone Advanced, as video is not supported in Unity iPhone Basic, this is how I implemented a video before anything else. Awake and Start are called pretty much immediately, so the easiest place to put your call is there. It's a basic function call and not much else to it. (I am currently not on my Mac so I can't point you to the class reference) If you have done that correctly then the video will play immediately. The tricky part though, is that if you play your game and end up coming back to the menu it'll play the video again. Typically you don't want this to happen as it is kind of annoying especially if you don't give a tap to skip option. (which you probably should) What I did to get around that is check your current time (Time.time) in Awake or Start (ours was 0 because it executed right away), just before you call the video. Add a little leeway for contingency and then do something like this:
Since it will most likely be impossible to skip the video, start playing the game, pause, quit back to main menu in the time it takes your Time.time to increase from 0 to 1 you won't see the video play every time you return to the menu, only on application launch. Another way to do it would be tell the video to play on Awake inside of a check for a static boolean something like this:
This is probably the more simple method. Cheers, ==
(comments are locked)
|
|
If you're looking for the way to play a movie (and not just how to do it on startup), look in your hard drive scripting reference for It should be located here: /Applications/Unity%20iPhone/Unity%20iPhone.app/Contents/Documentation/Documentation/ScriptReference/iPhoneUtils.PlayMovie.html
(comments are locked)
|

Do you have iPhone advanced? That is necessary.