Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

AssetBunlde.LoadFromFile

Discussion in 'Android' started by fuy, Nov 26, 2015.

  1. fuy

    fuy

    Joined:
    Sep 24, 2014
    Posts:
    30
    Can AssetBunlde.LoadFromFile load one assetbundle in streamingAssetPath On android ?
    i dont want use WWW to load the assetbundle, i just want a sync api(with better performance)
     
  2. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    818
    Why dont you try it?
     
  3. ChiuanWei

    ChiuanWei

    Joined:
    Jan 29, 2012
    Posts:
    130
    i know there is a plugin named like "7zip lzma lz4..." can do this .
     
  4. fuy

    fuy

    Joined:
    Sep 24, 2014
    Posts:
    30
    Yes, i tried. but failed. code:
    Code (CSharp):
    1. string filePath = "jar:file://" + Application.dataPath + "!/assets/Bundles/11.data";
    2. AssetBundle.LoadFromFile(filePath);
     
  5. ChiuanWei

    ChiuanWei

    Joined:
    Jan 29, 2012
    Posts:
    130
    you cant do like this.
     
  6. night-yan

    night-yan

    Joined:
    Dec 12, 2013
    Posts:
    2
    Code (CSharp):
    1. string filePath = Application.dataPath + "!assets/Bundles/11.data";
    2. AssetBundle.LoadFromFile(filePath);