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(); }
private void DrawResults() { if (SpriteDatabase == null) { return; } EditorGUILayout.BeginVertical("Box"); EditorGUILayout.LabelField("Results", EditorStyles.toolbarDropDown); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginHorizontal("Box"); EditorGUI.BeginChangeCheck(); visualizationType = (VisualizationType)GUILayout.SelectionGrid((int)visualizationType, VISUALIZATION_NAMES, 3, EditorStyles.radioButton); if (EditorGUI.EndChangeCheck()) { CreateResultViewByVisualizationType(); SpriteAuditorUtility.ClearSelection(); SpriteAuditorUtility.SetResultViewDirty(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal("Box"); ResultView.DrawFilterOptions(); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndHorizontal(); DrawSearch(); SpriteAuditorBatchAction.DrawBatchActions(); ResultView.DrawResults(SpriteDatabase); EditorGUILayout.EndVertical(); }