private void OnEnable() { if (EditorPrefs.HasKey(LastLanguageDatatableEditedKey)) { string assetPath = EditorPrefs.GetString(LastLanguageDatatableEditedKey); LanguageDatatable languageDatatable = AssetDatabase.LoadAssetAtPath <LanguageDatatable>(assetPath); if (languageDatatable != null) { _languageDatatableSo = new SerializedObject(languageDatatable); } } if (_languageDatatableSo != null) { if (_treeViewState == null) { _treeViewState = new TreeViewState(); } if (_languageDatatableDrawer == null) { _languageDatatableDrawer = new LanguageDatatableDrawer(_treeViewState, CreateMultiColumnHeader()); } } }
public override void OnInspectorGUI() { serializedObject.Update(); { LanguageDatatableDrawer.Draw(serializedObject); DrawOpenWindowButton(); } serializedObject.ApplyModifiedProperties(); }
void OnEnable() { if (_treeViewState == null) { _treeViewState = new TreeViewState(); } if (_languageDatatableDrawer == null) { _languageDatatableDrawer = new LanguageDatatableDrawer(_treeViewState, CreateMultiColumnHeader()); } }
private MultiColumnHeader CreateMultiColumnHeader() { bool isFirstInit = _multiColumnHeaderState == null; var headerState = new MultiColumnHeaderState(LanguageDatatableDrawer.CreateColumnHeaders()); if (MultiColumnHeaderState.CanOverwriteSerializedFields(_multiColumnHeaderState, headerState)) { MultiColumnHeaderState.OverwriteSerializedFields(_multiColumnHeaderState, headerState); } _multiColumnHeaderState = headerState; MultiColumnHeader multiColumnHeader = new MultiColumnHeader(_multiColumnHeaderState); if (isFirstInit) { multiColumnHeader.ResizeToFit(); } return(multiColumnHeader); }
private void OnGUI() { LanguageDatatableDrawer.Draw(_languageDatatableSo); }