14 Replies
What do you mean?
if I create a thread that just runs a function, how do I get the name of that function?
You can't get it inside the the thread unless you pass it somehow.
You can technically use reflection as well, but it's better to just pass it imo
could I do this with async or something?
No, async won't work with getting the name via reflection
oh
I'm not exactly sure what are you trying to achieve though 😅
I am trying to make a loading screen that runs on another thread asynchronously and it will tell you what is currently running.
Ah so basically, the main thread loads assets and you want your loading screen that runs on a different thread to show the user the current step i.e
Loading textures
Loading 3d objects... etc
Right?
yeah
like I have a list of actions
nvm i just found out
Okay, couple of notes here
First Why are you
new
ing a Task manually? You're await
ing it couple of lines after creating it
Second, why are you using Task.WhenAll instead of await
?I was doing it with multithreading
but I changed it and realised the answer
is this better?
Yeah, it's much better imo 😅
alr
thanks