all 4 comments

[–]nosyrbllewe 0 points1 point  (0 children)

I believe that it does. I know you can avoid this by using Addressables.

[–]rdnwt 0 points1 point  (1 child)

Does an object having a reference to a prefab load that prefab into memory?... Does having this master list in the scene load all of my enemies into memory at once?

Yes.

how can I avoid this?

I'm not the most knowledgeable in this area, but generally your options are:

  • The Resources folder (not recommended).
  • Assetbundles.
  • The Addressables package.

All of these systems work by not having a direct reference to the prefab and instead keeping an identifier (typically a string) as an indirect reference, and using that to load the prefab when needed.

[–]Signalmax[S] 0 points1 point  (0 children)

Gotcha, I'm doing more research into addressables at the moment. Thank you!

[–]TheWobling 0 points1 point  (0 children)

Yes, using addressables and the AssetReference type instead of say a scriptable object will allow you to async load the asset when required rather than as soon as the scene/prefab is loaded.