RecastNavigationEditorModule.cpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <RecastNavigationModuleInterface.h>
  9. #include <RecastNavigationEditorSystemComponent.h>
  10. #include <EditorComponents/EditorDetourNavigationComponent.h>
  11. #include <EditorComponents/EditorRecastNavigationMeshComponent.h>
  12. #include <EditorComponents/EditorRecastNavigationPhysXProviderComponent.h>
  13. namespace RecastNavigation
  14. {
  15. class RecastNavigationEditorModule
  16. : public RecastNavigationModuleInterface
  17. {
  18. public:
  19. AZ_RTTI(RecastNavigationEditorModule, "{a8fb0082-78ab-4ca6-8f63-68c98f1a6a6d}", RecastNavigationModuleInterface);
  20. AZ_CLASS_ALLOCATOR(RecastNavigationEditorModule, AZ::SystemAllocator);
  21. RecastNavigationEditorModule()
  22. {
  23. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  24. // Add ALL components descriptors associated with this gem to m_descriptors.
  25. // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext.
  26. // This happens through the [MyComponent]::Reflect() function.
  27. m_descriptors.insert(m_descriptors.end(), {
  28. RecastNavigationEditorSystemComponent::CreateDescriptor(),
  29. EditorDetourNavigationComponent::CreateDescriptor(),
  30. EditorRecastNavigationMeshComponent::CreateDescriptor(),
  31. EditorRecastNavigationPhysXProviderComponent::CreateDescriptor(),
  32. });
  33. }
  34. //! Add required SystemComponents to the SystemEntity.
  35. //! Non-SystemComponents should not be added here.
  36. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  37. {
  38. return AZ::ComponentTypeList {
  39. azrtti_typeid<RecastNavigationEditorSystemComponent>(),
  40. };
  41. }
  42. };
  43. }// namespace RecastNavigation
  44. #if defined(O3DE_GEM_NAME)
  45. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME, _Editor), RecastNavigation::RecastNavigationEditorModule)
  46. #else
  47. AZ_DECLARE_MODULE_CLASS(Gem_RecastNavigation_Editor, RecastNavigation::RecastNavigationEditorModule)
  48. #endif