private void RefreshContent() { // Try to refresh the database! SharedEditorDataManager.TryRefreshDatabaseAtStart(); _externalEditorData = SharedEditorDataManager.GetListOfExternalEditorData(); _localEditorData = SharedEditorDataManager.GetLocalSharedData(); }
private void OnEnable() { _target = (SharedEditorData)target; _drawIdentitySettings = new SavedBool($"{nameof(SharedEditorDataEditor)}.DrawIdentitySettings", false); _drawContent = new SavedBool($"{nameof(SharedEditorDataEditor)}.DrawContent", false); UniqueGUID = serializedObject.FindProperty(nameof(UniqueGUID)); LevelSpawnNames = serializedObject.FindProperty(nameof(LevelSpawnNames)); UniqueDatabases = serializedObject.FindProperty(nameof(UniqueDatabases)); }
private void DrawDatabaseRecord <TDatabase, TItem>(SharedEditorData data) where TDatabase : DatabaseManager <TItem> where TItem : DatabaseItem { string perfName = $"{nameof(SharedContentEditorWindow)}.{data.UniqueGUID}.{typeof(TDatabase).Name}"; EditorGUIUtility.labelWidth += 150; var records = data.GetRecords <TDatabase, TItem>(); if (records != null) { foreach (var c in records) { var drawDatabase = new SavedBool($"{perfName}.{c.Name}", false); drawDatabase.value = EditorGUILayout.BeginFoldoutHeaderGroup(drawDatabase.value, c.Name); if (drawDatabase.value) { EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUI.indentLevel++; foreach (var r in c.Records) { var drawRecord = new SavedBool($"{perfName}.{c.Name}.{r.Identity}", false); drawRecord.value = EditorGUILayout.Foldout(drawRecord.value, r.Name); if (drawRecord.value) { EditorGUI.indentLevel++; EditorGUILayout.LabelField("Name", r.Name); EditorGUILayout.LabelField("Identity", r.Identity.ToString()); var drawProperties = new SavedBool($"{perfName}.{c.Name}.{r.Identity}.Properties", false); drawProperties.value = EditorGUILayout.Foldout(drawProperties.value, "Properties"); if (drawProperties.value) { EditorGUI.indentLevel++; foreach (var p in r.Properties) { EditorGUILayout.LabelField(p.Key, p.Value); } EditorGUI.indentLevel--; EditorGUILayout.Space(); } EditorGUI.indentLevel--; EditorGUILayout.Space(); } } EditorGUI.indentLevel--; EditorGUILayout.Space(); } EditorGUILayout.EndFoldoutHeaderGroup(); } } EditorGUIUtility.labelWidth -= 150; }