Search Unity

I can not Load AssetBundle on iPad

Discussion in 'iOS and tvOS' started by redocx, Oct 19, 2013.

  1. redocx

    redocx

    Joined:
    Dec 13, 2012
    Posts:
    23
    I create a .unity3d file and put it in StreamingAssets folder as shown below:
    $xxx.jpg
    And I Load it like this:

    string path = Application.dataPath + "/Raw/PopView.unity3d";
    WWW www = new WWW(path);
    yield return www;
    AssetBundle astBdl = www.assetBundle;
    Object ast = astBdl.Load("ArmyView");
    GameObject gb = GameObject.Instaniate(ast) as GameObject;

    When I run it on iPad xcode throws errors, but when I run it on Unity3D Editor with the path "Application.dataPath + "/StreamingAssets/PopView.unity3d", it's OK.

    What should I do if I want to load .unity3d file on ipad?
    I wish someone could help me, Thank You!

    I uploaded the error and the path printed by Xcode:
    $Error.jpg

    $Path.jpg
     
    Last edited: Oct 21, 2013
  2. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    What errors do you get? Were the asset bundles built for iOS? Maybe the runtime cannot find the file? I usually think of StreamingAssets as a folder used for storing fullscreen movies on iOS. I'm not sure that all files in that folder get copied across to the iOS device. (I might be wrong, but that's why I asked for more details about the error.)
     
  3. redocx

    redocx

    Joined:
    Dec 13, 2012
    Posts:
    23
    Yeah, I create .unity3d file on Mac. I don't have Mac beside me now so I can not tell the errors. But I agree with you that maybe the runtime cannot find the file, so could you tell me the correct way load .unity3d file on the ipad platform?(My poor English, forgive me)
     
  4. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
  5. redocx

    redocx

    Joined:
    Dec 13, 2012
    Posts:
    23
  6. zaptech123

    zaptech123

    Joined:
    Sep 2, 2013
    Posts:
    9

    Attached Files:

    Last edited: May 12, 2014
  7. vkajudiya

    vkajudiya

    Joined:
    Mar 24, 2014
    Posts:
    9
    hi . haveing Same issue i have data.bin file on root of asset folder
    after build it for ios i cant find and load level from data.bin file.
    i dont know data.bin file is copyed in build or not how to check ? is there any solution ?
    can i put data.bin file in resource foder and use it on ios device to read or right ?