${Name}EditorModule.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // {BEGIN_LICENSE}
  2. /*
  3. * Copyright (c) Contributors to the Open 3D Engine Project.
  4. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. *
  6. * SPDX-License-Identifier: Apache-2.0 OR MIT
  7. *
  8. */
  9. // {END_LICENSE}
  10. #include <${Name}/${Name}TypeIds.h>
  11. #include <${Name}ModuleInterface.h>
  12. #include "${Name}EditorSystemComponent.h"
  13. namespace ${SanitizedCppName}
  14. {
  15. class ${SanitizedCppName}EditorModule
  16. : public ${SanitizedCppName}ModuleInterface
  17. {
  18. public:
  19. AZ_RTTI(${SanitizedCppName}EditorModule, ${SanitizedCppName}EditorModuleTypeId, ${SanitizedCppName}ModuleInterface);
  20. AZ_CLASS_ALLOCATOR(${SanitizedCppName}EditorModule, AZ::SystemAllocator);
  21. ${SanitizedCppName}EditorModule()
  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. ${SanitizedCppName}EditorSystemComponent::CreateDescriptor(),
  29. });
  30. }
  31. /**
  32. * Add required SystemComponents to the SystemEntity.
  33. * Non-SystemComponents should not be added here
  34. */
  35. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  36. {
  37. return AZ::ComponentTypeList {
  38. azrtti_typeid<${SanitizedCppName}EditorSystemComponent>(),
  39. };
  40. }
  41. };
  42. }// namespace ${SanitizedCppName}
  43. AZ_DECLARE_MODULE_CLASS(Gem_${SanitizedCppName}, ${SanitizedCppName}::${SanitizedCppName}EditorModule)