I’m downloading the 3D model from server using of Assetbundle. I’m getting the model from url but when i attached to the gamer object of Prefab it showing error and the cube is not showing “setting the parent of a transform which resdes in a prefab is dusabled to prevent data corruption”,
public GameObject imageTarget;
private GameObject mBundleInstance = null;
using (WWW www = WWW .LoadFromCacheOrDownload(bundleURL, Version)) {
yield return www;
Debug.Log (Version);
if (www .error != null)
throw new UnityException("WWW Download had an error: " + www .error);
AssetBundle bundle = www .assetBundle;
if (AssetName == "") {
Debug.Log ("null");
mBundleInstance = Instantiate (bundle.mainAsset) as GameObject;
mBundleInstance.transform.parent = imageTarget.transform;
mBundleInstance.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
mBundleInstance.transform.localPosition = new Vector3(0.0f, 0.15f, 0.0f);
mBundleInstance.transform.gameObject.SetActive(true);
}
I have met this problem too, but I don't solve it .Whether you solve it?
– ubanck