diff --git a/Scripts/Editor.meta b/Scripts/Editor.meta
index ad115e1..2eb0e89 100644
--- a/Scripts/Editor.meta
+++ b/Scripts/Editor.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: e47e43ba2c8708b40a62a67958bcea44
+guid: 9d4c2e3c55b93e940bdd8c2cdc1605bf
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Scripts/Editor/Design_Tools/ItemConfigEditor.cs b/Scripts/Editor/Design_Tools/ItemConfigEditor.cs
index 41bdd8a..5f48421 100644
--- a/Scripts/Editor/Design_Tools/ItemConfigEditor.cs
+++ b/Scripts/Editor/Design_Tools/ItemConfigEditor.cs
@@ -1624,6 +1624,31 @@ namespace DesignTools
currentPage = totalPages - 1;
}
+ ///
+ /// 根据Res字段获取完整资源路径
+ ///
+ private string GetFullResourcePath(string res)
+ {
+ if (string.IsNullOrEmpty(res)) return "";
+
+ string[] parts = res.Split(',');
+ if (parts.Length < 2) return "";
+
+ if (!int.TryParse(parts[0], out int tableId)) return "";
+ if (!int.TryParse(parts[1], out int itemId)) return "";
+
+ if (itemId < 0) return ""; // 未选择Item
+
+ var table = allArtTables.FirstOrDefault(x => x.TableId == tableId);
+ if (table == null) return "";
+
+ var item = table.Items.FirstOrDefault(x => x.Id == itemId);
+ if (item == null) return "";
+ if (item.Sprite == null) return "";
+
+ return AssetDatabase.GetAssetPath(item.Sprite);
+ }
+
///
/// 保存数据到Excel
///
@@ -1671,7 +1696,7 @@ namespace DesignTools
var worksheet = package.Workbook.Worksheets[ITEM_SHEET_NAME];
// 找到列索引
- int idCol = -1, nameCol = -1, iTypeCol = -1, effectCol = -1, resCol = -1;
+ int idCol = -1, nameCol = -1, iTypeCol = -1, effectCol = -1, resCol = -1, fullResourcePathCol = -1;
int columnCount = worksheet.Dimension.Columns;
for (int col = 1; col <= columnCount; col++)
@@ -1682,6 +1707,7 @@ namespace DesignTools
else if (header == "IType") iTypeCol = col;
else if (header == "Effect") effectCol = col;
else if (header == "Res") resCol = col;
+ else if (header == "FullResourcePath") fullResourcePathCol = col;
}
// 创建Id到行号的映射(读取现有数据)
@@ -1729,6 +1755,13 @@ namespace DesignTools
{
worksheet.Cells[targetRow, resCol].Value = item.Res;
}
+
+ // 写入完整资源路径
+ if (fullResourcePathCol > 0)
+ {
+ string fullPath = GetFullResourcePath(item.Res);
+ worksheet.Cells[targetRow, fullResourcePathCol].Value = fullPath;
+ }
}
// 删除已不存在的数据行(只清空我们管理的列)
@@ -1746,6 +1779,7 @@ namespace DesignTools
worksheet.Cells[row, iTypeCol].Value = null;
if (effectCol > 0) worksheet.Cells[row, effectCol].Value = null;
if (resCol > 0) worksheet.Cells[row, resCol].Value = null;
+ if (fullResourcePathCol > 0) worksheet.Cells[row, fullResourcePathCol].Value = null;
}
}
}