2016-03-15 73 views
1

我創造團結含有一個場景用下面的代碼的AssetBundle:團結火場移至空曠加載資產捆綁後

string[] scenes = {"Assets/Scenes/main.unity"}; 
BuildPipeline.BuildStreamedSceneAssetBundle(scenes , "main.unity3d", EditorUserBuildSettings.activeBuildTarget); 

我有一個在應用程序的啓動加載主場景中的空簡介場景在iOS上:

using (WWW www = WWW.LoadFromCacheOrDownload (url + "main.unity3d", 0)) { 

while (!www.isDone) { 
    yield return null; 
} 

//check if server response is an error 
if (www.error != null) { 
    throw new Exception ("WWW download had an error: " + www.error); 
} 

//Load the asset bundle 
AssetBundle bundle = www.assetBundle; 
bundle.LoadAllAssets(); 

} 
Application.LoadLevel ("main") 

的問題是,在主場景裝入正確,但在它的3D對象(FBX文件+紋理)都看不出來。主場景沒有腳本,只有3D對象,包括簡單的Unity多維數據集,它們已經作爲預製存儲在Assets文件夾中。 什麼可能是錯誤的,3D數據不顯示?資產包本身大約有20MB,這絕對是3D對象應該包含的大小。我使用Unity 5.2.4,這只是iOS中的一個問題,Android正在工作,對象正常顯示。

回答

2

我找到了解決方案。您必須關閉Unity中的「Strip Engine Code」