Lets say that I have 500MB of textures in my “Assets” folder. Are they going to be all pre-loaded to RAM during startup even if I don’t use them immediately?
If my GameObject structure is created fully at run-time then NONE of those textures are going to be included in a build. Correct?
No. It’s a by-reference thing. If the assets are referenced in a scene, in a prefab in a scene, or in a prefab (or other asset) that you load at runtime, then they are loaded.
Remember, you can only directly load (using Resources.Load<>()) assets located under a Resources/ folder, but those assets can refer to other assets anywhere, which are all subsequently loaded when the base asset is loaded.
By the time control is returned to you after a particular call to load an asset, everything it depends upon has also been loaded.
I read that assets which are not referenced are not included in builds. I assume that references are derived statically using static game objects. If all my GO except one are dynamic then there is no way to know what to include in a build.
If you read a bit further you will see that everything that falls UNDER any folder anywhere named Resources is actually included in the build, and can be loaded at runtime.
Otherwise yes, it is a dependency tree, driven by what scenes are included in the build.