Author Topic: How to make scene loading animation??  (Read 7431 times)

rayleigh

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
How to make scene loading animation??
« on: July 12, 2014, 09:27:41 AM »
huhu
How can i make a loading animtion when i click example start then the loading animtion from 0-100% come.
How can i make this??
Sorry for my bad english

Mickman

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: How to make scene loading animation??
« Reply #1 on: July 15, 2014, 05:27:15 PM »
I am also interested in this topic.. hope someone can provide a good example that utilises NGUI.  In the mean time here's how to do it in Unity3D 

The simple way:

Create a scene that will be your loading screen, do what you want to do with this scene (an animation or whatever you want). Don't forget to make this small to load.

Create an object with a script and in the Update function of this script just put these lines:

if(Application.GetStreamProgressForLevel("levelName") ==1){
    Application.LoadLevel("levelName");
}
Make sure that you put these scenes in order when publishing:

LoadScreen
Leve1
LoadScreen
Level2
...

The Application.GetStreamProgressForLevel() function return a float number between 0 and 1, you can use this to make a progress bar too.

---------
If you have Unity Pro  you should use  " Application.LoadLevelAsync " 
Loads the level asynchronously in the background.

Unity will completely load all assets and all objects in the scene in a background loading thread. This allows you to load new levels while still playing the current one, show a progress bar or create a completely streaming world where you constantly load and unload different parts of the world based on the player position, without any hiccups in game play.

http://docs.unity3d.com/ScriptReference/Application.LoadLevelAsync.html

« Last Edit: July 15, 2014, 05:42:11 PM by Mickman »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to make scene loading animation??
« Reply #2 on: July 15, 2014, 11:40:29 PM »
Load a blank scene that contains a UI covering the entire screen with a progress bar on it. Inside the scene in some script's Start() function, additively load another level with the actual content using Application.LoadLevelAdditiveAsync. Update the progress bar's value based on the AsyncOperation's progress value. When the loading is complete, hide the progress bar UI.