31
NGUI 3 Support / UIAtlasMaker public API
« on: November 12, 2013, 06:16:29 PM »
Would you mind exposing more of the atlas maker's functionality? I'm trying to automate updating all of the sprites in an atlas from a directory containing the textures, and it's really slow doing it one at a time, and I can't remove sprites with what's currently public. I'm looking for something along these lines:
- public static void UpdateAtlas(UIAtlas atlas, List<Texture> textures, bool keepSprites)
- {
- if (atlas != null && textures != null)
- {
- List<SpriteEntry> sprites = CreateSprites(textures);
- ExtractSprites(atlas, sprites);
- if (!keepSprites)
- {
- sprites.RemoveAll((se) => (textures.Find((t) => t.name == se.name) == null));
- }
- UpdateAtlas(atlas, sprites);
- }
- }