Search Unity

[WHY] AssetName and AssetBundleName Problem

Discussion in 'Editor & General Support' started by gyd, Aug 6, 2015.

  1. gyd

    gyd

    Joined:
    Nov 9, 2012
    Posts:
    15
    1. AssetName is path included ( solved )

    in the thread
    http://forum.unity3d.com/threads/new-assetbundle-build-system-in-unity-5-0.293975/
    has a example project, it load asset by it's name, ex: cube

    but in my project,
    i have to load the asset by full path, is anything wrong?

    file location:
    Assets/BundleResources/SFX/fireEffect.prefab
    AssetBundleName is set as "sfx/fireeffect" to prefab directly.

    my build script:
    Code (csharp):
    1.  
    2. string path = GetLocalBundleUrl().Replace( "file://", "" );
    3. Directory.CreateDirectory(path);
    4. path = EditorUtility.SaveFolderPanel("Save to", path, "" );
    5.  
    6. BuildPipeline.BuildAssetBundles (path, 0, EditorUserBuildSettings.activeBuildTarget );
    7.  
    what i suppose it should be, same as the example project:
    Code (csharp):
    1.  
    2. AssetBundle bundle = GetBundle( "sfx/fireeffect" );
    3. bundle.LoadAsset( "fireEffect" );
    4.  
    but it is
    Code (csharp):
    1.  
    2. AssetBundle bundle = GetBundle( "sfx/fireeffect" );
    3. bundle.LoadAsset( "Assets/BundleResources/SFX/fireEffect.prefab" );
    4.  

    2. why AssetBundleName can only set a lower case string?


    Update: my issue 1 is cased by case-sensitive, because i built my bundles with it's name, but i have to translate to lower case when i load it because of issue 2
     
    Last edited: Aug 6, 2015