Search Unity

Loading prefabs dynamically: Scriptable Object or Asset Bundle?

Discussion in 'Editor & General Support' started by anpShawn, Aug 8, 2016.

  1. anpShawn

    anpShawn

    Joined:
    Oct 1, 2012
    Posts:
    18
    My game has a large collection of menus that I store as prefabs so I can load them as need be.

    I currently load them through the Resources folder, but I've heard that I should avoid the Resources folder altogether.

    It seems I can write a scriptable object that references a menu, then create an instance of that scriptable object. But if my game has 100 menus, that means I need 100 SOs. Even with a menu creation shortcut, it seems like a lot of extra fluff.

    It looks like I can also stick them all into a 'menu' Asset Bundle, but the whole process seems like a lot of work for something that I already have a working solution for. Asset Bundles also seem to be geared toward downloading remote content. But, maybe I just need to bite the bullet and do things the "right" way.

    As far as I can tell the only downside to the Resources folder is that a large lookup table (of sorts) needs to be generated at run-time. Does this cost not apply to Asset bundles? Or is the benefit simply that this cost can be sub-divided as need be?

    Any thoughts on the best way to proceed with this?
     
    Last edited: Aug 8, 2016