I’m trying to set up game initialization and runtime in threads so that they won’t cause the UI to lock up until the function finishes. I’m wondering if there’s any way that I could directly access the UI canvas and its elements from a background thread (changing the UI screen from main menu, pause screen, inventory screen, etc) or would I have to emulate a thread in the Update function and use the threads to apply variables that Update checks periodically?
All of Unity’s API is unfortunately only available from the main thread. However, if your initialization includes a lot of non-Unity specific stuff like, say, file reading for instance, you could use a separate thread and then return to the main thread afterwards. I personally use Thread Ninja by Ciela Spike for this, as it even allows you change threads from within the same method. This is great if you want to read 1000 files for instance, then create a Texture2D from that data or something.