Hi Unity people,
I’m trying to use an editor C# script to iterate through some Prefabs make a copy, slightly modify it, and assign it to it’s own AssetBundle.
I would like to define the AssetBundle without actually building it as I iterate over my prefabs and the variants I make. Instead creating the variants now, and building the necessary bundles at a later time.
Any help would be appreciated. Thanks.
Hello,
It sounds like you’re working on a Unity project and you want to use an editor C# script to streamline the process of creating variants of Prefabs and assigning them to separate AssetBundles.
To achieve this, you can define the AssetBundles without actually building them immediately as you iterate through your prefabs and create variants. Instead, you can set up the structure and configurations for these AssetBundles during the iteration process and then build them at a later stage when all variants have been created.
This approach allows you to have better control and flexibility in managing your asset bundles. If you need assistance with the specific code or methods for achieving this in Unity, feel free to provide more details, and we’d be happy to offer further guidance.
You can also have a look on this resolved forums question:-
https://forum.unity.com/threads/can-we-load-only-required-assets- njmcdirect-dependencies-when-loading-asset-bundles.1326750/
Hey, sorry for the delay. What you can do is use AssetImporter.GetAtPath(pathToAsset).assetBundleName
to assign the AssetBundle via a script. If you need, there’s also the AssetImporter.GetAtPath(pathToAsset).assetBundleVariant
property to allow you to use Bundle variants.
I hope that helps!