private static void MoveSpritesToAtlas(SpriteAtlas newAtlas) { foreach (Object selectedObject in SpriteAuditorUtility.SelectedObjects) { if (selectedObject is Sprite targetSprite) { TryToRemoveSpriteFromAnyAtlasReference(targetSprite); if (newAtlas == null) { continue; } Debug.Log($"Added {targetSprite} to {newAtlas}"); newAtlas.Add(new[] { selectedObject }); EditorUtility.SetDirty(newAtlas); } } SpriteAuditorUtility.ClearSelection(); SpriteAuditorUtility.SetAllDirty(); }