Progress Bar

Last time you guys were so much help, I thought I would try it again.

I am trying to create a progress bar that will increase along with the player’s score. Once the bar hits the specified amount, the bar will reset and it will activate the multiplier. I understand the “back end” part of what I am trying to do. However, I am having trouble visualizing it for the player.

So my question is: How do I visualize a progress, that will adjust in size with a variable?

I usually do progress bar with a group and a texture. The tricky part is to find the %

var percentage : float = 1.0; // Up to you here, something like current / max
GUI.BeginGroup( Rect( 10, 10, 100 * percentage, 10 ) );
    GUI.DrawTexture( Rect( 10, 10, 100, 10 ), tex ); // Note the 100 for the width
GUI.EndGroup();

tex can be a white texture of size (1,1), that way you can change the color with GUI.color. Now, for the multiplier, that concerns the percentage calculation.

I would do something along the lines of

float t = (currentScore-startScore)/(maxScore-startScore); 
float maxWidth = 400; //the total width of your progress bar 
yourGUITexture.pixelInset = new Rect(0, 0, maxWidth * t, 50);

You basically get the percentage of the filled bar and scale your bar by that value.