- Home /
Question by
davidflynn2 · Nov 29, 2012 at 07:06 PM ·
c#
Creating Loading Bar For web Player
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();
}
}
}
Comment
Best Answer
Answer by Graham-Dunnett · Dec 04, 2012 at 02:21 PM
A google search showed up:
http://answers.unity3d.com/questions/7846/how-do-i-make-a-progress-bar.html
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Any one knows how this is done? 1 Answer
java to C# 2 Answers
error CS0246 anybody help? 1 Answer
Distribute terrain in zones 3 Answers