Quantcast
Channel: Questions in topic: "assetbundles"
Viewing all articles
Browse latest Browse all 312

AssetBundle doesn't load serialized values in children

$
0
0
Hi guys, first time working with Asset Bundles and I can't seem to get them to work quite right. I have a prefab with a simple hierarchy - a MonoBehaviour on the parent and some children with their own MonoBehaviours. All MonoBehaviors have [SerializeField] properties with non-default values saved in the prefab. I've added this prefab to an asset bundle using BuildPipeline.BuildAssetBundles, which seems to work fine, however, when loading the assets during runtime, only the parent MonoBehaviour has it's fields deserialized properly, and all the children get default values. References to other GameObjects work fine, but raw data gets reset (or maybe isn't saved properly the first time). I'm loading the asset bundle like this: var assetBundle = AssetBundle.LoadFromFile("Assets/AssetBundles/bundle"); var asset = assetBundle.LoadAsset("Name"); Instantiate(asset); Any clue why this isn't deserializing properly? Thanks!

Viewing all articles
Browse latest Browse all 312

Trending Articles



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