AssetBundle doesn't load serialized values in children

ساخت وبلاگ

Vote count: 0

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!

asked 57 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 277 تاريخ : سه شنبه 5 ارديبهشت 1396 ساعت: 16:04