Hi,
I was wondering if I could get a straight answer from someone on this question. The forums all say different things. What is the best way to load large assets at runtime? Direct reference in a script or Resources.Load? I know technically Unity supports direct reference so that the build will know what assets to not include. I use direct reference for most assets in my game. However I have around 85 levels (represented by scriptable object files) and I don’t really want to load all 85 of them at once, especially since they have large prefabs attached–but I know I definitely want to load them at some point one at a time. In this case, is it better to use Resources.Load? Or should I pile them all onto a “resources” GameObject I put in my initial scene with DontDestroyOnLoad? Seems like that method would eat up a bunch of memory, unless Unity will automatically handle what’s not being used?
I have currently tried a few options with Resources.load, which all ended horribly since Unity5. Especially on Android. Even in my smallest level, with really nothing in it–Resources.Load will take around 12 seconds. I used to use Resources.LoadAll in a certain folder at app start, and that made my app launch last around 20-30secs. The thing is, after the first use of Resources.Load, any subsequent use is pretty fast–it turns into what I’d consider to be normal load times.
I’d really like to launch my game, but this is becoming a nasty issue. With Resources.Load, it’s looking like I inevitably have to suffer a long load time somewhere in my user’s first 2 minutes–which is the most important window for capturing users. It’d be great to get some guidance here. Some forums say it’s better to use direct reference regardless of asset size…but this is a lot of large assets.
What about Resources.loadasync?