Home > other >  The expansion of the Unity of NGUI controls
The expansion of the Unity of NGUI controls

Time:09-23

I want to extend the progress bar bar values change the text into the style of the "current value/Max", below is my code

Public class DivideShowLabel: UILabel
{
Public void ShowLabelInDivide ()
{
Var maxValue=https://bbs.csdn.net/topics/520;
If (UIProgressBar. Current==null) return;
Var progress=UIProgressBar. Current. The value;
Text=Mathf. RoundToInt (progress * maxValue) + "/" + maxValue.
}
}
I would like to ask how do I define a maximum value of the variable on the outside of the method, if I directly outside the method defining value always be 0.
And how to make the definition of a variable shows on the front panel? Online, etc,,,

CodePudding user response:

Didn't listen to understand, we define a public variable line!

CodePudding user response:

[0, 1] and [min and Max] interval mapping.
  • Related