This question got marked as duplicate as it involves creating dynamically named variables. But the thing that I'm after is to create a number of dynamic sliders, so those .net answers aren't helping me.
The sliders are the same physical size and their names are held within an array, and their number is known. However, it could be one it could be twent, hence the need for dynamic slider creation.
This doesn't work:
for (int i = 0; i < numOfCheeseMonkeys; i++)
{
slider + i = GUI.HorizontalSlider(new Rect(25, 50 + (i * 30), 150, 25), slider + i, 0.0F, 100.0F);
}
...this will, but it's stoopid:
sliderA = GUI.HorizontalSlider(new Rect(25, 50 + (i * 30), 150, 25), sliderA, 0.0F, 100.0F);
sliderB = GUI.HorizontalSlider(new Rect(25, 50 + (i * 30), 150, 25), sliderB, 0.0F, 100.0F);