- Home /
show progress while generating worldmap in start() function
I'm building the game with random generation world-map inside Start() function, and it would be nice to see how long or how far the progress is till it's done generating the map. Is there a way to call other functions same time and show/draw them in game and/or in the editor while the game is being generated? call function to show how far it's going from the start()-function.
Answer by IJM · Jan 12, 2017 at 12:01 PM
By calling a method from a Unity Start() event you are blocking Unity's main thread, until that method is finished. (Your game is frozen)
You want to do it in the background, so that you can still update graphics on the screen. (Like progress bar for example)
You'll have to use Coroutines, or Threads.
p.s.
If you are using Unity specific stuff inside your Build() method , and I'm guessing that you are, Coroutines are way to go.
That's a pretty good answer. I might try using coroutines. I'm using forloops to make 2D-grid so.. maybe I get it working.
Your answer
Follow this Question
Related Questions
Initialising List array for use in a custom Editor 1 Answer
Lifebar Help 1 Answer