Search Unity

Setting the AssetBundle name of a SpriteAtlas through scripts

Discussion in '2D' started by hsallander, Aug 6, 2019.

  1. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    46
    I'm writing editor scripts to migrate from the old legacy sprite sheets to the new sprite atlases. It's all working fine but I'm having troubles finding how I can set the AssetBundle name of the SpriteAtlas objects I've created. Looking in the file system I see that the assetBundleName and assetBundleVariant elements are actually in the .meta file and not in the actual .spriteatlas file so I guess that's why they're not exposed as public variables in the SpriteAtlas class. So basically: how can I set the assetBundleName on a SpriteAtlas through scripts?