private void OnEnable() { m_needToUpdateSO = true; m_needToApplyBeforeUpdateSO = false; m_lastApply = System.DateTime.Now; s_instance = this; titleContent.text = "Text Table"; m_needRefreshLists = true; Undo.undoRedoPerformed += Repaint; if (m_textTableInstanceID != 0) { Selection.activeObject = EditorUtility.InstanceIDToObject(m_textTableInstanceID); } m_toolbarSelection = EditorPrefs.GetInt(ToolbarSelectionPrefsKey, 0); if (EditorPrefs.HasKey(SearchBarPrefsKey)) { var searchBarSettings = JsonUtility.FromJson <SearchBarSettings>(EditorPrefs.GetString(SearchBarPrefsKey)); if (searchBarSettings != null) { m_isSearchPanelOpen = searchBarSettings.open; m_searchString = searchBarSettings.searchString; m_replaceString = searchBarSettings.replaceString; m_matchCase = searchBarSettings.matchCase; } } OnSelectionChange(); }
private void OnDisable() { if (m_serializedObject != null) { m_serializedObject.ApplyModifiedProperties(); } s_instance = null; Undo.undoRedoPerformed -= Repaint; EditorPrefs.SetInt(ToolbarSelectionPrefsKey, m_toolbarSelection); }
private void OnProjectWindowItemOnGUI(string guid, Rect selectionRect) { // Check for double-clicks to open editor window: var doubleClicked = Event.current.type == EventType.MouseDown && Event.current.clickCount == 2 && selectionRect.Contains(Event.current.mousePosition); if (doubleClicked) { TextTableEditorWindow.ShowWindow(); } }
private void OnEnable() { s_instance = this; #if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 title = WindowTitle; #else titleContent.text = "Text Table"; #endif m_needRefreshLists = true; Undo.undoRedoPerformed += Repaint; OnSelectionChange(); }
private void OnEnable() { s_instance = this; titleContent.text = "Text Table"; m_needRefreshLists = true; Undo.undoRedoPerformed += Repaint; if (m_textTableInstanceID != 0) { Selection.activeObject = EditorUtility.InstanceIDToObject(m_textTableInstanceID); } OnSelectionChange(); }
private void OnEnable() { m_needToUpdateSO = true; m_needToApplyBeforeUpdateSO = false; m_lastApply = System.DateTime.Now; s_instance = this; titleContent.text = "Text Table"; m_needRefreshLists = true; Undo.undoRedoPerformed += Repaint; if (m_textTableInstanceID != 0) { Selection.activeObject = EditorUtility.InstanceIDToObject(m_textTableInstanceID); } m_toolbarSelection = EditorPrefs.GetInt(ToolbarSelectionPrefsKey, 0); OnSelectionChange(); }
private void OnDisable() { if (m_serializedObject != null) { m_serializedObject.ApplyModifiedProperties(); } s_instance = null; Undo.undoRedoPerformed -= Repaint; EditorPrefs.SetInt(ToolbarSelectionPrefsKey, m_toolbarSelection); var searchBarSettings = new SearchBarSettings(); searchBarSettings.open = m_isSearchPanelOpen; searchBarSettings.searchString = m_searchString; searchBarSettings.replaceString = m_replaceString; searchBarSettings.matchCase = m_matchCase; EditorPrefs.SetString(SearchBarPrefsKey, JsonUtility.ToJson(searchBarSettings)); }
public override void OnInspectorGUI() { if (TextTableEditorWindow.isOpen) { EditorGUILayout.HelpBox("A Text Table is a database of text fields and translations into any number of languages. Edit it in the Text Table window.", MessageType.None); } else { EditorGUILayout.HelpBox("A Text Table is a database of text fields and translations into any number of languages. To edit it, click on the Open Text Table Editor button below.", MessageType.None); if (GUILayout.Button("Open Text Table Editor")) { TextTableEditorWindow.ShowWindow(); } } if (m_textTable.languages.Count != m_languageCount || m_textTable.fields.Count != m_fieldCount) { UpdateLabelText(); } EditorGUILayout.LabelField(m_languageCountText); EditorGUILayout.LabelField(m_fieldCountText); // Debug: DrawDefaultInspector(); }
private void OnDisable() { s_instance = null; Undo.undoRedoPerformed -= Repaint; }