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. Dismiss Notice

AssetBundle and Player Build: exclude assets from player?

Discussion in 'Editor & General Support' started by azeitler, May 2, 2009.

  1. azeitler

    azeitler

    Joined:
    May 14, 2008
    Posts:
    162
    Hi there,

    can I build AssetBundles in the Editor via Script and have the same Assets that have been built to Bundles ignored and not included again when I build the Player later on?
    I am already using PushAssetDependencies and PopAssetDependencies when building the AssetBundles, but the bundled Assets are still inlcuded in the Player itself.

    Is there a way to ignore Assets in the Build process of the Player, e.g. a whole Folder within the Assets of the project?
    Would the bundled assets be ignored when I build the bundles and the player within the same Editor function?
     
  2. azeitler

    azeitler

    Joined:
    May 14, 2008
    Posts:
    162
    Has anybody any ideas on this?
     
  3. _creatio_

    _creatio_

    Joined:
    Mar 21, 2013
    Posts:
    43
    Hi, I'm having the same question.
    Is there any way to mark assets as "not-to-be-used-by-editor-build-pipeline" when I already added them to AssetBundles?
     
  4. zibizz1

    zibizz1

    Joined:
    Oct 11, 2012
    Posts:
    17
    Bump
    I don't need in bundles, assets that are already build with player. Because when I later load bundle i have in memory two copies of the same shader, and other things that are manually hard to track. Is there any automatic solution to not include in budnle assets that are alrady in player?
     
  5. richardfu71

    richardfu71

    Joined:
    Mar 26, 2014
    Posts:
    4
    old post still without answer...?
    I am also in the process changing all Resource and prefabs to Asset Bundle...
    and somehow find that there's a lot limitation and very less support in asset bundle...
     
  6. PfcGarcia

    PfcGarcia

    Joined:
    Aug 27, 2013
    Posts:
    17
    As I understand if non-Resources asset has no references in any scene required in build then it's not included in resulting .unity3d file. Do you have another case? I'm exporting prefabs in AssetBundles using this code:

    Code (CSharp):
    1.  
    2.             // Build the resource file from the active selection.
    3.             Object[] selection = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);
    4.             BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets);
    5.             Selection.objects = selection;
    6.  
    They are in Assets folder, not Resources, they are not referenced by any GameObject in any scene and I could not find them while researching internals of resulting .unity3d Web build (I use https://github.com/ata4/disunity for that).

    Are you sure they are actually in build? Are they used in your scenes or not?