A progress bar to display proportion completed of Editor extension processing
If an Editor task is going to take more than half a second or so, then we should indicate progress complete/remaining to the user via a progress bar so that they understand that something is actually happening and the application has not crashed and frozen.
Getting ready
This recipe adds to the previous one, so make a copy of that project folder and do your work for this recipe with that copy.
How to do it...
To add a progress bar during the loop (and then remove it after the loop is complete), replace the PlacePrefabs()
method with the following code:
static void PlacePrefabs(){ ...
Get Unity 5.x Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.