Build two bundle. One contain soldier.prefab. Another contain SoldiersConfig.asset.
Create two button in scene Load and Unload
load button event:
Load two bundle if it not loaded.
Load soldier.prefab asset.
print hp in sc.
unload button event:
1.make sure NO Managed Object reference soldier.prefab asset (soldier.prefab not used).
2. Unload the bundle contain SoldiersConfig.asset, NOT unload the bundle contain soldier.prefab.
Running:
1.press Load button, SoldiersConfig can be loaded. Got right result.
2.press Unload button.
3.press Load button again. got error:
A scripted object (script unknown or not yet loaded) has a different serialization layout when loading.
If dependence Asset is texture or material. it can be reload again when load prefab. why ScriptableObject can not?
Certainly seems a bit weird - there are some difference between AssetBundles in the Editor and Player which may be a culprit. If you could submit a bug report then we’ll get someone on the engineering team to look into it for you.