void TableCollectionSelected(LocalizedTableCollection ltc) { m_TableContents.Clear(); if (m_CurrentEditor != null) { m_CurrentEditor.OnDisable(); } if (ltc == null || ltc.TableType == null) { return; } var editorType = GetEditorTypeForCollection(ltc.GetType()); if (editorType == null) { return; } m_CurrentEditor = (TableEditor)Activator.CreateInstance(editorType); m_CurrentEditor.TableCollection = ltc; m_TableContents.Add(m_CurrentEditor); m_CurrentEditor.StretchToParentSize(); m_CurrentEditor.OnEnable(); }
void ResolveTableCollection() { m_PossibleTableCollection.Clear(); m_Collection = LocalizationEditorSettings.GetCollectionFromTable(m_TargetTable); if (m_TargetTable.SharedData == null) { return; } m_SharedTableDataSerializedObject = new SerializedObject(m_TargetTable.SharedData); m_TableCollectionName = m_SharedTableDataSerializedObject.FindProperty("m_TableCollectionName"); if (m_Collection != null) { m_CollectionButton = new GUIContent("Select Collection", EditorGUIUtility.ObjectContent(m_Collection, m_Collection.GetType()).image); return; } m_SharedTableDataCollection = LocalizationEditorSettings.GetCollectionForSharedTableData(m_TargetTable.SharedData); if (m_SharedTableDataCollection != null) { return; } LocalizationEditorSettings.FindLooseStringTablesUsingSharedTableData(m_TargetTable.SharedData, m_PossibleTableCollection); }