三国卡牌客户端基础资源仓库
yyl
2 天以前 6001904b846cd53ce6715967a9d22a313c94e0d9
125 【战斗】战斗系统 图集设置 查重新增关键词匹配
2个文件已修改
88 ■■■■■ 已修改文件
Assets/Editor/SpritePacking/SpriteSettings.asset 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/UI/AssetDuplicateCheck.cs 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/SpritePacking/SpriteSettings.asset
@@ -497,3 +497,25 @@
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 50
  - folderName: BossBattle
    blockOffset: 1
    enableRotation: 0
    enableTightPacking: 0
    padding: 4
    readable: 0
    generateMipMaps: 0
    sRGB: 1
    filterMode: 1
    platformSettings:
    - name: Standalone
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 4
    - name: Android
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 50
    - name: iPhone
      maxTextureSize: 2048
      textureCompression: 1
      textureFormat: 50
Assets/Editor/UI/AssetDuplicateCheck.cs
@@ -21,7 +21,7 @@
        private bool includeSubfolders = true;
        private bool compareByContent = true;
        private bool compareByName = false;
        private int minFileSize = 10;
        private int minFileSize = 100;
        
        private Dictionary<string, List<string>> duplicateGroups = new Dictionary<string, List<string>>();
        private int totalFilesScanned = 0;
@@ -36,6 +36,9 @@
        private bool isProcessing = false;
        private float progress = 0f;
        private string progressInfo = "";
        private string filterString = "";
        private bool enableFilter = false;
        [MenuItem("工具/资源管理/资源查重工具")]
        public static void ShowWindow()
@@ -84,6 +87,13 @@
            }
            EditorGUILayout.Space();
            // 搜索结果过滤功能
            EditorGUILayout.BeginVertical();
            enableFilter = EditorGUILayout.Toggle("启用结果过滤", enableFilter, GUILayout.Width(120));
            EditorGUILayout.Space();
            filterString = EditorGUILayout.TextField("过滤字符串", filterString);
            EditorGUILayout.EndVertical();
            if (duplicateGroups.Count > 0)
            {
@@ -168,7 +178,7 @@
            includeSubfolders = EditorGUILayout.Toggle("包含子文件夹", includeSubfolders);
            compareByContent = EditorGUILayout.Toggle("按内容比较", compareByContent);
            compareByName = EditorGUILayout.Toggle("按名称比较", compareByName);
            minFileSize = EditorGUILayout.IntField("最小文件大小 (KB)", minFileSize);
            minFileSize = EditorGUILayout.IntField("最小文件大小 (B)", minFileSize);
            
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("处理选项:");
@@ -196,88 +206,92 @@
        private void DrawResults()
        {
            EditorGUI.indentLevel++;
            EditorGUILayout.BeginHorizontal();
            showFullPath = EditorGUILayout.Toggle("显示完整路径", showFullPath);
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("全选", GUILayout.Width(60)))
            {
                SelectAll(true);
            }
            if (GUILayout.Button("全不选", GUILayout.Width(60)))
            {
                SelectAll(false);
            }
            if (GUILayout.Button("智能选择", GUILayout.Width(80)))
            {
                SmartSelect();
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
            int groupIndex = 0;
            foreach (var group in duplicateGroups)
            {
                // 过滤逻辑:只显示包含过滤字符串的组
                if (enableFilter && !group.Value.Any(f => Path.GetFileName(f).IndexOf(filterString, StringComparison.OrdinalIgnoreCase) >= 0))
                    continue;
                if (group.Value.Count <= 1) continue;
                groupIndex++;
                EditorGUILayout.BeginVertical(GUI.skin.box);
                string groupTitle = $"组 {groupIndex}: {group.Value.Count} 个文件";
                if (group.Value.Count > 0)
                {
                    string fileName = Path.GetFileName(group.Value[0]);
                    groupTitle += $" - {fileName}";
                }
                EditorGUILayout.LabelField(groupTitle, EditorStyles.boldLabel);
                foreach (string filePath in group.Value)
                {
                    EditorGUILayout.BeginHorizontal();
                    bool isSelected = false;
                    if (selectedForRemoval.ContainsKey(filePath))
                    {
                        isSelected = selectedForRemoval[filePath];
                    }
                    bool newSelected = EditorGUILayout.Toggle(isSelected, GUILayout.Width(20));
                    if (newSelected != isSelected)
                    {
                        selectedForRemoval[filePath] = newSelected;
                    }
                    string displayPath = showFullPath ? filePath : Path.GetFileName(filePath);
                    FileInfo fileInfo = new FileInfo(Path.Combine(Application.dataPath, "..", filePath));
                    string fileDetails = $"{displayPath} - {fileInfo.Length / 1024} KB";
                    if (fileInfo.Exists)
                    {
                        fileDetails += $" - {fileInfo.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")}";
                    }
                    EditorGUILayout.LabelField(fileDetails);
                    if (GUILayout.Button("选择", GUILayout.Width(60)))
                    {
                        Selection.activeObject = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(filePath);
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUILayout.EndVertical();
                EditorGUILayout.Space();
            }
            EditorGUI.indentLevel--;
        }
@@ -386,7 +400,7 @@
                    
                    // 检查文件大小
                    FileInfo fileInfo = new FileInfo(fullPath);
                    if (!fileInfo.Exists || fileInfo.Length < minFileSize * 1024) continue;
                    if (!fileInfo.Exists || fileInfo.Length < minFileSize) continue;
                    
                    string key = "";
                    
@@ -527,8 +541,6 @@
                        
                        // 更新引用关系,将引用从filePath重定向到keepFile
                        UpdateReferences(filePath, keepFile);
                        // ... existing code ...
                        
                        // 创建备份和删除文件的代码
                    }