Search Unity

create AssetBundleBuild with more files

Discussion in 'Scripting' started by ghiboz, Oct 13, 2015.

  1. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    hi all! I wish create an assetbundle that contains some text files that are textassets into my project..
    the strange thing is if I do this:
    Code (CSharp):
    1. AssetBundleBuild buildInfo = new AssetBundleBuild { assetBundleName = "textAssets.unity3d",
    2.     assetNames = new [] {"Assets/firstFile.txt"}};
    3. }
    it works and create an textAssets.unity3d with the file inside, but if I do this:
    Code (CSharp):
    1. AssetBundleBuild buildInfo = new AssetBundleBuild { assetBundleName = "textAssets.unity3d",
    2.     assetNames = new [] {"Assets/firstFile.txt", "Assets/secondFile.txt"}};
    3. }
    it doesn't work, seems that I need to create a assetbundle for each prefab/file.txt
    thanks for your help