| 316 | } |
| 317 | |
| 318 | void PluginManagerImpl::InitializePlugins() |
| 319 | { |
| 320 | if (EditorPlugins.Count() + GamePlugins.Count() == 0) |
| 321 | return; |
| 322 | PROFILE_CPU_NAMED("InitializePlugins"); |
| 323 | PROFILE_MEM(Scripting); |
| 324 | |
| 325 | auto engineAssembly = ((NativeBinaryModule*)GetBinaryModuleFlaxEngine())->Assembly; |
| 326 | auto pluginLoadOrderAttribute = engineAssembly->GetClass("FlaxEngine.PluginLoadOrderAttribute"); |
| 327 | auto afterTypeField = pluginLoadOrderAttribute->GetField("InitializeAfter"); |
| 328 | ASSERT(afterTypeField); |
| 329 | |
| 330 | #if USE_EDITOR |
| 331 | auto editorPlugins = SortPlugins(EditorPlugins, pluginLoadOrderAttribute, afterTypeField); |
| 332 | for (auto plugin : editorPlugins) |
| 333 | { |
| 334 | PluginManagerService::InvokeInitialize(plugin); |
| 335 | } |
| 336 | #else |
| 337 | // Game plugins are managed via InitializeGamePlugins/DeinitializeGamePlugins by Editor for play mode |
| 338 | auto gamePlugins = SortPlugins(GamePlugins, pluginLoadOrderAttribute, afterTypeField); |
| 339 | for (auto plugin : gamePlugins) |
| 340 | { |
| 341 | PluginManagerService::InvokeInitialize(plugin); |
| 342 | } |
| 343 | #endif |
| 344 | } |
| 345 | |
| 346 | void PluginManagerImpl::DeinitializePlugins() |
| 347 | { |
nothing calls this directly
no test coverage detected