Search Unity

Loading Everything in asset bundle

Discussion in 'Asset Bundles' started by nsmith1024, Oct 29, 2019.

  1. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Hello,

    At run-time i download an asset bundle, I want to extract everything so they all appear as if they are in the resource folder of the running unity app, for example if the asset bundle contained a prefab called "monster" normally i would have to do this

    var prefab=bundle.LoadAsset("monster");
    Instantiate(prefab);

    Instead of doing that, i want to load everything in the downloaded asset bundle so that everything in there acts as if its in the resource folder, so that i can do this directly and not have to the bundle.LoadAsset("monster") step, like this

    Instantate("monster")

    Is this possible?

    Thanks