Hello,
I'm trying to use a progress bar (UISlider) with a text label (UILabel) to show progress during a coroutined WWW import. If I don't try to update the label, the progress bar and debug statements update as the data loads, but while trying to update the label, it freezes everything until the import is done. My guess is that the progress bar updates as it is just affecting the scale of the foreground element, while the text actually needs to be calculated. I've tried calling the label's update geometry (inherited from UIWidget) but that didn't work. I assume that the geometry itself is received during the panel's draw call?
If anyone has advice for this, or if I'm just going about it completely wrong, all feedback is welcomed.
And if anyone would like a look at code, here's a small bit of the first part. I modified UISlider to have a UILabel variable so I could modify associated text through progress bars:
using(WWW import
= new WWW
("file://" + pathToFile
)){ while(!import.isDone){
progressBar.sliderValue = import.progress;
progressBar.textField.text("LOADING " + import.progress / import.size + "/" + import.size);
progressBar.textField.UpdateGeometry(progressBar.textField.panel, true);
Debug.Log("Import: " + import.progress);
yield return new WaitForEndOfFrame
(); }
}