- Home /
How to Preload entire web game with a Loading progressbar?
Hi there, Our game works fine on offline.But when we stream the game from web.When clicked play,The second scene buffers slowly and scene remain in current main menu .Our game size is 6.5 MB .We understand that we need a preloader or at least some load progress bar indicating the stream is in progress.We used load level async and we even purchased scene preloader from asset store .But that package just works in one scene .It doesn't preload the entire game.We will be very thankful to you if u could help us from this situation.I have attached link below please check http://griffininfosystems.com/games/TEST_LOAD/
Answer by Bunny83 · Sep 17, 2014 at 12:17 PM
In general you have two options:
Don't use "streamed" in which case Unity will download your complete game before even starting the first scene.
Using "streamed" and design some kind of loading scene as the first scene.
I guess you want to go for the second option. In this case it's important to note, that you should keep the first scene as small as possible so it's loaded fast. Avoid using "Resources" folders as they are shipped with the first scene.
To display a progressbar you can use Application.GetStreamProgressForLevel to get a value between 0 and 1 for each level. There is no loading progress for the whole game, but you can simply accumulate the values for each level and divide by the level count (simply the arithmetic mean).
edit
Besides GetStreamProgressForLevel there's also Application.CanStreamedLevelBeLoaded which just returns a boolean if the given level has finished downloading. This could be used to enable / disable startbuttons for each individual level.
Thx bunny, i don't know how i missed this .Checking off streamed checkbox in build setting solved the issue .However permanent and correct solution will be ur second option which ill try next.
Your answer
Follow this Question
Related Questions
Facebook Interaction LoadLevelAsync Progress Freezes 0 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
Web Player only can run in opera 0 Answers
Problems with MyLoader.png and 100% fit to page 4 Answers
progressbarimage flickering 0 Answers