/// <summary> /// Replace the sprites within the atlas. /// </summary> static public void ReplaceSprites(UIAtlas atlas, List <SpriteEntry> sprites) { // Get the list of sprites we'll be updating List <UISpriteData> spriteList = atlas.spriteList; List <UISpriteData> kept = new List <UISpriteData>(); // Run through all the textures we added and add them as sprites to the atlas for (int i = 0; i < sprites.Count; ++i) { SpriteEntry se = sprites[i]; UISpriteData sprite = AddSprite(spriteList, se); kept.Add(sprite); } // Remove unused sprites for (int i = spriteList.Count; i > 0;) { UISpriteData sp = spriteList[--i]; if (!kept.Contains(sp)) { spriteList.RemoveAt(i); } } // Sort the sprites so that they are alphabetical within the atlas atlas.SortAlphabetically(); atlas.MarkAsChanged(); }
static int SortAlphabetically(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 1); UIAtlas obj = (UIAtlas)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIAtlas"); obj.SortAlphabetically(); return(0); }
static public int SortAlphabetically(IntPtr l) { try { UIAtlas self = (UIAtlas)checkSelf(l); self.SortAlphabetically(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int SortAlphabetically(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UIAtlas obj = (UIAtlas)ToLua.CheckObject <UIAtlas>(L, 1); obj.SortAlphabetically(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public static int SortAlphabetically(IntPtr l) { int result; try { UIAtlas uIAtlas = (UIAtlas)LuaObject.checkSelf(l); uIAtlas.SortAlphabetically(); LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
/// <summary> /// Replace the sprites within the atlas. /// </summary> static public void ReplaceSprites (UIAtlas atlas, List<SpriteEntry> sprites) { // Get the list of sprites we'll be updating List<UISpriteData> spriteList = atlas.spriteList; List<UISpriteData> kept = new List<UISpriteData>(); // Run through all the textures we added and add them as sprites to the atlas for (int i = 0; i < sprites.Count; ++i) { SpriteEntry se = sprites[i]; UISpriteData sprite = AddSprite(spriteList, se); kept.Add(sprite); } // Remove unused sprites for (int i = spriteList.Count; i > 0; ) { UISpriteData sp = spriteList[--i]; if (!kept.Contains(sp)) spriteList.RemoveAt(i); } // Sort the sprites so that they are alphabetical within the atlas atlas.SortAlphabetically(); atlas.MarkAsChanged(); }