2025-02-07 16:15:34 +08:00
|
|
|
using UnityEditor;
|
2025-03-20 20:48:16 +08:00
|
|
|
|
2025-02-07 16:15:34 +08:00
|
|
|
|
|
|
|
namespace UnityEngine.UI
|
|
|
|
{
|
|
|
|
[CustomEditor(typeof(UXTextMeshPro), true)]
|
|
|
|
[CanEditMultipleObjects]
|
|
|
|
public class UXTextMeshProEditor : TMPro.EditorUtilities.TMP_EditorPanelUI
|
|
|
|
{
|
|
|
|
private SerializedProperty text;
|
|
|
|
private SerializedProperty localizationID;
|
|
|
|
|
|
|
|
protected override void OnEnable()
|
|
|
|
{
|
|
|
|
text = serializedObject.FindProperty("m_text");
|
|
|
|
localizationID = serializedObject.FindProperty("m_localizationID");
|
|
|
|
base.OnEnable();
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OnInspectorGUI()
|
|
|
|
{
|
|
|
|
serializedObject.Update();
|
|
|
|
bool isPlay = Application.isPlaying;
|
|
|
|
|
|
|
|
|
2025-02-21 10:22:11 +08:00
|
|
|
// Key选择逻辑
|
2025-03-13 16:40:06 +08:00
|
|
|
EditorGUILayout.PropertyField(localizationID);
|
|
|
|
|
|
|
|
//
|
|
|
|
// // 显示预览信息
|
|
|
|
// EditorGUI.BeginDisabledGroup(true);
|
|
|
|
// {
|
|
|
|
// EditorGUILayout.PropertyField(localizationID);
|
|
|
|
// if (!string.IsNullOrEmpty(localizationID.stringValue))
|
|
|
|
// {
|
|
|
|
// var entry = _entries.Find(e => e.ID == localizationID.stringValue);
|
|
|
|
// if (entry != null)
|
|
|
|
// {
|
|
|
|
// EditorGUILayout.TextField("当前文本预览", entry.ChineseSimplified);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// EditorGUI.EndDisabledGroup();
|
2025-02-07 16:15:34 +08:00
|
|
|
|
|
|
|
serializedObject.ApplyModifiedProperties();
|
|
|
|
base.OnInspectorGUI();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|