0

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;
             }
         }
     }
4

1 回答 1

1

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

这是为不同平台制作不同资产包的脚本。

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

于 2015-01-30T11:19:16.900 回答