This repo will help you create asset bundles, based on project structure.
We want to create multiple asset bundle, but without tagging them specifically, but use project structure, to define the bundles appropriately.
- Maintaining a structure to fetch assets for asset bundles.
- Create asset bundles using editor script.
- Load asset bundles from streaming assets.
- Unity Engine 2021.3.0f1, you can download it from here.
Assets/Scripts/Editor/AssetBundleCreator.cs
is used to create asset bundleAssets/Scripts/AssetBundleController.cs
is used to load assets bundle fromStreamingAssets/Bundles
.
- We will load assets from
Assets/LocalAssets
path, the sub folder defined inside wil act as individual asset bundles, any content within these subfolder will be part of the respective assetbundle.
- This project loads bundle from
StreamingAssets/Bundles
, if you want to learn how we can fetch from Firebase(or get idea about CDN), check my UnityFirebaseDemo Repo.