There was an error while loading. Please reload this page.
1 parent 38ce7a6 commit 2f197a0Copy full SHA for 2f197a0
1 file changed
Source/Mcro/Public/Mcro/Modules.h
@@ -13,6 +13,7 @@
13
#include "CoreMinimal.h"
14
#include "Modules/ModuleInterface.h"
15
#include "Modules/ModuleManager.h"
16
+#include "Interfaces/IPluginManager.h"
17
#include "Mcro/AssertMacros.h"
18
#include "Mcro/TextMacros.h"
19
#include "Mcro/TypeName.h"
@@ -103,6 +104,13 @@ namespace Mcro::Modules
103
104
return *result;
105
}
106
107
+ /** @brief Get the owning plugin of a given module */
108
+ template <CDerivedFrom<IModuleInterface> M>
109
+ TSharedPtr<IPlugin> GetModulePlugin()
110
+ {
111
+ return IPluginManager::Get().GetModuleOwnerPlugin(*InferModuleName<M>());
112
+ }
113
+
114
/** @brief Add this interface to your module class if other things can listen to module startup or shutdown */
115
class MCRO_API IObservableModule : public IModuleInterface
116
{
0 commit comments