GeomNodesEditorModule.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include <GeomNodesModuleInterface.h>
  2. #include "Editor/Components/EditorGeomNodesSystemComponent.h"
  3. #include "Editor/Components/EditorGeomNodesComponent.h"
  4. #include "Editor/Systems/GeomNodesSystem.h"
  5. #include <Editor/Configuration/GNEditorSettingsRegistryManager.h>
  6. namespace GeomNodes
  7. {
  8. class GeomNodesEditorModule
  9. : public GeomNodesModuleInterface
  10. {
  11. public:
  12. AZ_RTTI(GeomNodesEditorModule, "{49C42A73-EF4E-4D42-8ECF-0ADE7F942CCD}", GeomNodesModuleInterface);
  13. AZ_CLASS_ALLOCATOR(GeomNodesEditorModule, AZ::SystemAllocator);
  14. GeomNodesEditorModule()
  15. : m_gnSystem(AZStd::make_unique<GNEditorSettingsRegistryManager>())
  16. {
  17. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  18. // Add ALL components descriptors associated with this gem to m_descriptors.
  19. // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext.
  20. // This happens through the [MyComponent]::Reflect() function.
  21. m_descriptors.insert(m_descriptors.end(), {
  22. EditorGeomNodesSystemComponent::CreateDescriptor(),
  23. EditorGeomNodesComponent::CreateDescriptor(),
  24. });
  25. }
  26. virtual ~GeomNodesEditorModule()
  27. {
  28. m_gnSystem.Shutdown();
  29. }
  30. /**
  31. * Add required SystemComponents to the SystemEntity.
  32. * Non-SystemComponents should not be added here
  33. */
  34. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  35. {
  36. return AZ::ComponentTypeList {
  37. azrtti_typeid<EditorGeomNodesSystemComponent>(),
  38. azrtti_typeid<EditorGeomNodesComponent>(),
  39. };
  40. }
  41. private:
  42. GeomNodesSystem m_gnSystem;
  43. };
  44. }// namespace GeomNodes
  45. AZ_DECLARE_MODULE_CLASS(Gem_GeomNodes, GeomNodes::GeomNodesEditorModule)