- Home /
The proper way of setting up scenes
Hi, I know this question might seem a bit odd, but what is the proper way of managing the default setup of a game scene? What I mean by that is that I might be done through code (say, a GameManagement script that instantiates needed Objects right after the program starts) or manually (operating on the scene view and assets by hand).
I guess wrapping it into a script makes it less messy in hierarchy but at the same time harder to read and understand. What's the general habit I should stick to, that's commonly accepted and seen as correct?
Appreciate any help, thanks in advance!
Answer by FortisVenaliter · Sep 28, 2017 at 06:40 PM
Script in dynamic objects when you have to, but keep anything you can in the scene itself.
Unity will load in everything it knows comes with a scene when you load the scene. Anything you load yourself after, you have to deal with the responsiveness while loading. So, unless you want to add your own loading code that deals with all that, try to keep the post-scene load as limited as possible.
Thanks a lot for the reply, that's a valuable piece of advice.
Having that said, unfortunatelly I cannot think of another way of implementing randomized objects into the default scene without instantiating them directly within a script... Well, I guess I'll just think about it for a longer while and see how it turns out. Once again, thank you.
Correct, with programmatic content, you have no choice, you have to instantiate everything afterwards. You probably just want to do that asynchronously and show a progress bar while you do.