I have the following code setup so that my level does not load till everthing is ready but how do I add a loading bar. This is in C#.
My Code:
public float percentageLoaded = 0;
public Texture2D background;
void OnGUI()
{
GUI.DrawTexture(new Rect(0,0,Screen.width,Screen.height), background);
}
void Update()
{
if (Application.GetStreamProgressForLevel("Demo") == 1)
{
guiText.text = "";
Application.LoadLevel("Demo");
}
else
{
percentageLoaded = Application.GetStreamProgressForLevel("Demo") * 100;
guiText.text = percentageLoaded.ToString();
}
}
}