How to compress assets into one file

Is there a way to compress a lot of assets into one file and then load from that file?
The problem is that I have A LOT of files, 30k+ and they are all .3ds format 3d models to be more specific.
Up till now I had all of them added in /Resources/ folder and then when I need to load one I would use Resource.Load(). It works fine, nothing wrong with it, how ever considering there’s so many files, when I try to build my app to standalone it simply crashes with OUT OF MEMORY error after the Unity editor reaches 1.8GB memory usage lol… :rage:

So yeh, is there any way I could compress all those models into one file and then load certain assets from that file when I need to similar to the way I do now with Resource.Load() ? I don’t need that file to be streaming from some external website or anything, it can sit there on local drive

Thanks

You need pro and use Asset Bundles.

you can’t load them from external, there is no support for external models at all. also they would end worlds larger and less efficient actually.

I don’t need to load them from external, that file can just sit somewhere on local disk.
So the asset bundles will work? Because I never used them so I wasn’t really sure…

By the way, what does “Dependency tracking” mean? When creating the asset bundle it asks whether I want to track dependencies or have no dependency tracking. Can’t find any documentation explaining that :S

Thanks

if you add a mesh that has a material applied to it, it will automaticly also add the material in the bundle.

Oh, I see… But it’s a bit weird because I was testing it with “No dependency”, packed some .3ds models into the asset bundle, then I even deleted the material of those models which was generated by unity after I imported the models, then I tried loading the model from assetbundle using AssetBundle.Load() and it loaded it WITH material? :face_with_spiral_eyes:
Although my models don’t have any textures, just simple colors.

Anyways, is there any way to modify this Asset Bundle creation script so I wouldn’t need to select which assets to add to the bundle but it would automatically build a bundle off all assets in specified folder? Because when I try to select all 30k models manually it makes the Unity editor crash with OUTOFMEMORY error… :expressionless:

Here’s the script:

@MenuItem("Assets/Build AssetBundle From Selection - No dependency tracking")
static function ExportResourceNoTrack () {

    var path = "Y:/10001-14000.unity3d";
    if (path.Length != 0)
    {
 
        BuildPipeline.BuildAssetBundle(Selection.activeObject, Selection.objects, path);
    }
}

Thanks