Hi guys,
i want to create a simple progress bar for my game.I looked into unity gui and came up across EditorUtility.DisplayProgressBar which seems to be something for the editor and not to be used inside the game actually.Is there something or will i have to write my own logic?
Thx
There is no built-in progress bar for use in the run-time engine, so you’ll need to script one up on your own (which shouldn’t be too hard).
yup thats right.i jst wanted to see if there was already some hidden unity thing to use.by any chance cud u be remembering the math for range mapping.i need to map the percentage complete to the length of progress bar but i forgot the math.
thx
Perhaps you can share more details but in general, the pseudo-code looks like:
-
Determine the completion percentage of the operation in question (get a value between 0.0 and 1.0, 0.0 being just begun and 1.0 being complete).
-
To determine your progress bar width you multiply its maximum width (width at completion) by your progress percentage (current width = completion percentage x maximum width)