cancel
Showing results for 
Search instead for 
Did you mean: 

DebugUI AddLabel issues

kingarrilla
Explorer
DebugUIBuilder.instance.AddSlider("Gain", 0.0f, 4.0f, SliderPressed, false, 2);

1) When this Slider appears in the panel, the slider label is set to "slider label" - should it not read "Gain"?

To get it to read "Gain" I have to set it explicitly

var sliderPrefab = DebugUIBuilder.instance.AddSlider("Gain", 0.0f, 4.0f, SliderPressed, false, 2);

var textElementsInSlider = sliderPrefab.GetComponentsInChildren<Text>();

Assert.AreEqual(textElementsInSlider.Length, 2, "Slider prefab format requires 2 text components (label + value)");

sliderText = textElementsInSlider[1];

Assert.IsNotNull(sliderText, "No text component on slider prefab");

textElementsInSlider[0].text = "Gain";


2) How can I set the initial value of the slider? For example, in this use the initial value of Gain is 1.0f but the slider is set at 0. It's not a show stopper, but useful to have this default value to be set somewhere in the range.

0 REPLIES 0