Search Unity

Problem with Sprite Packer, asset bundles and prefabs in Resource folder

Discussion in '2D' started by zbyhoo, Mar 18, 2015.

  1. zbyhoo

    zbyhoo

    Joined:
    Nov 18, 2013
    Posts:
    17
    1) Does sprite packer packs sprites that are referenced by prefabs located in Resource folder (sprites files themselves are located outside of Resource folder)?

    I cannot make it work. I set up Sprite Packer Mode to Always Enabled. Every sprite has proper tag specified. Sprite atlases are not created.

    2) When creating asset bundle from prefab that references sprites packed by Sprite Packer, bundle contains packed sprites (atlas texture) and each individual sprite texture itself. How can I configure asset bundle creation to not include single sprites, but atlas sprite only?

    I'm using Unity 4.6.1 on OS X.
     
  2. zbyhoo

    zbyhoo

    Joined:
    Nov 18, 2013
    Posts:
    17
    Answer to myself:
    1) By mistake I modified sprite's texture type from Sprite2D to Advanced and in this situation Sprite Packer didn't packed them.

    But second question still is mystery to me. When build the game, only atlases are included. But when creating asset bundle, atlas and every sprite texture are included in asset bundle. Why?
     
  3. zbyhoo

    zbyhoo

    Joined:
    Nov 18, 2013
    Posts:
    17
    So I found also answer to seconds question.
    Problem was with BuildAssetBundleOptions. I had speficied:
    Code (CSharp):
    1. BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets
    and BuildAssetBundleOptions.CompleteAssets was the cause of importing sprites textures also.
     
    theANMATOR2b likes this.