UI系统组件
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using BaseGames.Dialogue;
|
||||
using BaseGames.Editor.Localization;
|
||||
|
||||
namespace BaseGames.Editor.Dialogue
|
||||
{
|
||||
@@ -78,30 +79,10 @@ namespace BaseGames.Editor.Dialogue
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 在 Project 窗口中 Ping 指定表名对应的本地化 JSON 文件(Resources/Localization/…/{tableName}.json)。
|
||||
/// 遍历所有语言目录,以第一个找到的文件为准。
|
||||
/// 在 Project 窗口中 Ping 指定表名对应的本地化 JSON 文件
|
||||
/// (Assets/_Game/Data/Localization/…/{tableName}.json,优先简体中文 → 英文)。
|
||||
/// </summary>
|
||||
private static void PingLocalizationFile(string tableName)
|
||||
{
|
||||
string[] guids = AssetDatabase.FindAssets(
|
||||
$"t:TextAsset {tableName}",
|
||||
new[] { "Assets/Resources/Localization" });
|
||||
|
||||
foreach (var guid in guids)
|
||||
{
|
||||
string path = AssetDatabase.GUIDToAssetPath(guid);
|
||||
// 文件名(不含扩展名)必须完全匹配 tableName
|
||||
if (!path.EndsWith($"/{tableName}.json", System.StringComparison.OrdinalIgnoreCase)) continue;
|
||||
|
||||
var asset = AssetDatabase.LoadAssetAtPath<TextAsset>(path);
|
||||
if (asset == null) continue;
|
||||
|
||||
EditorGUIUtility.PingObject(asset);
|
||||
Selection.activeObject = asset;
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.LogWarning($"[NpcSOEditor] 未找到本地化表文件:Resources/Localization/…/{tableName}.json");
|
||||
}
|
||||
=> LocalizationFileIO.PingAny(tableName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user