#if ENABLE_SEARCH using System.Collections.Generic; using UnityEditor.Localization.UI; using UnityEditor.Search; using UnityEditor.UIElements; using UnityEngine; using UnityEngine.Localization; using UnityEngine.Localization.Settings; using UnityEngine.Localization.Tables; using UnityEngine.UIElements; using Toggle = UnityEngine.UIElements.Toggle; namespace UnityEditor.Localization { abstract class TableReferenceField : Foldout where TCollection : LocalizationTableCollection { static readonly string k_None = L10n.Tr("Select Entry..."); const string k_MixedValues = "-"; VisualElement m_CachedInspectorElement; VisualElement m_CachedContextWidthElement; Label m_Label; Button m_Menu; Button m_OpenTableEditorButton; SerializedProperty m_TableProperty; SerializedProperty m_EntryProperty; TextField m_EntryNameField; VisualElement m_TableDetails; VisualElement m_ProjectLocaleDetails; VisualElement m_OtherLocaleDetails; TCollection m_Collection; SharedTableData.SharedTableEntry m_Entry; protected SerializedProperty m_LocalizedStringProperty; public TableReferenceField(string label, SerializedProperty localizedStringProperty) { text = label; m_LocalizedStringProperty = localizedStringProperty; m_Menu = new Button { style = { flexGrow = 1, paddingRight = 0, marginRight = 0 } }; m_Menu.clicked += OnSelectEntry; // Determine if we are editing a LocalizedString or LocalizedString.UxmlSerializedData m_TableProperty = localizedStringProperty.FindPropertyRelative("m_TableReference") ?? localizedStringProperty.FindPropertyRelative("TableReferenceUXML"); m_EntryProperty = localizedStringProperty.FindPropertyRelative("m_TableEntryReference") ?? localizedStringProperty.FindPropertyRelative("TableEntryReferenceUXML"); var toggle = this.Q(); m_Label = this.Q