Quantcast
Channel: Questions in topic: "assetbundle"
Viewing all articles
Browse latest Browse all 1593

How to store a prefab in an AssetBundle dynamically by an Editor Script?

$
0
0
Assume the prefab creation works fine: var prefab = PrefabUtility.CreatePrefab("Assets/Prefabs/myPrefab.prefab", myGameObject, ReplacePrefabOptions.Default); Means "prefab" is not null. But now I want to store/save the prefab in an AssetBundle. How is this archived? My try: var buildMap = new List { new AssetBundleBuild { assetBundleName = "MyPrefab in an AssetBundle", assetNames = new [] { AssetDatabase.GetAssetPath(prefab) } } }; var manifest = BuildPipeline.BuildAssetBundles("Assets/AssetBundle/uweTest.unity3d", buildMap.ToArray(), BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows); Any help would be great! Thanks in advance!

Viewing all articles
Browse latest Browse all 1593

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>