private static void InitializeEditorProvider() { void InitializeProvider() { var records = LoadOrDefault().GetAllRecords(); var provider = new EditorResourceProvider(); foreach (var record in records) { if (EditorUtils.AssetExistsByGuid(record.Value)) { provider.AddResourceGuid(record.Key, record.Value); } } ResourceProviderConfiguration.EditorProvider = provider; } Engine.OnInitializationStarted -= InitializeProvider; Engine.OnInitializationStarted += InitializeProvider; }
private static void InitializeEditorProvider() { void InitializeProvider() { var records = LoadOrDefault().GetAllRecords(); var provider = new EditorResourceProvider(); foreach (var record in records) { if (EditorUtils.AssetExistsByGuid(record.Value)) { provider.AddResourceGuid(record.Key, record.Value); } } var providerField = typeof(ResourceProviderConfiguration).GetField(nameof(ResourceProviderConfiguration.EditorProvider), BindingFlags.Static | BindingFlags.Public); providerField.SetValue(null, provider); } Engine.OnInitializationStarted -= InitializeProvider; Engine.OnInitializationStarted += InitializeProvider; }