private static void GetLocationTextList(string testStr) { textInfoList.Clear(); if (string.IsNullOrEmpty(testStr)) { textInfoList.Add(0, "不赋值"); foreach (var location in UILocationAsset.GetAll()) { if (textInfoList.ContainsKey(location.Key)) { //Debug.LogError(location.Key) } else { textInfoList.Add(location.Key, location.Value.Text); } } } else { foreach (var location in UILocationAsset.GetAll()) { if (location.Value.Text.Contains(testStr)) { textInfoList.Add(location.Key, location.Value.Text); } } } }
protected new void DrawTextInput() { EditorGUILayout.Space(); if (GUILayout.Button(" 刷新表格 ")) { UILocationAsset.Refresh(); } serializedObject.Update(); EditorGUILayout.LabelField($"当前文本:{mFishText.text}"); if (GUILayout.Button(" 赋值 ")) { SearchLocationTextWnd.ShowWindow(); } bool show = EditorGUILayout.Toggle("中文竖显", mFishText.showVertical); if (mFishText.showVertical != show) { mFishText.showVertical = show; } bool addColon = mFishText.addColon = EditorGUILayout.Toggle("添加冒号", mFishText.addColon); if (mFishText.addColon != addColon) { mFishText.addColon = addColon; } }
protected override void Awake() { base.Awake(); UILocation table = UILocationAsset.Get(m_ID); if (table == null) { return; } this.text = m_AddColon ? table.Text + ":" : table.Text; }
public static async void ShowWindow() { await UILocationAsset.Refresh(); EditorWindow.GetWindow(typeof(SearchLocationTextWnd)); }