Unity3d UnknownHostException

时间:2015-06-17 07:40:53

标签: unity3d

我尝试使用以下代码从我的服务器加载资产,但我可以

using (WWW www = WWW.LoadFromCacheOrDownload (url, version)) {
   while (!www.isDone) {
      progress = www.progress;
     yield return null;
   }

if (www.error != null) {
   throw new Exception ("WWW download:" + www.error + url);    
   callBack (false, www);
} else {
AssetBundleRef abRef = new AssetBundleRef (url, version);
abRef.assetBundle = www.assetBundle;
dictAssetBundleRefs.Add (keyName, abRef);
callBack (true, www);
}
AssetBundleManager.Unload (url, version, false);
}

但是,如果我尝试更改服务器URL,它工作正常。

请帮助!!!

1 个答案:

答案 0 :(得分:0)

也许你的Android设备被转为缓存。 检查一下:

if (!Caching.enabled)
    GUILayout.Label ("Caching is turned off.");