AssetBundle加载模型未在移动设备中显示

时间:2015-01-30 10:10:34

标签: android unity3d gameobject assetbundle

0 我正在从服务器URL加载3d模型并使用assetbundle,但是当我在unityeditor中加载模型时它工作正常并且立方体的3d模型显示正确。但是当我在android mobile中加载模型时,模型没有显示在屏幕上。

 IEnumerator GetAssetBundle() {

         string bundleURL = url;

         Debug.Log (bundleURL);
         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.localPosition = new Vector3(0,0,0);


             }
             else {
                 Debug.Log ("not null");
                 mBundleInstance = Instantiate(bundle.Load (AssetName)) as GameObject;
             }
         }
     }

1 个答案:

答案 0 :(得分:1)

ios,android和pc的资产包不是一回事。 你应该根据你正在使用的平台构建那些。

Here is脚本为不同平台制作不同的资产包。

此外,您应该知道您需要Unity PRO才能使用资产包。