${Name}EditorSystemComponent.cpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 <AzCore/Serialization/SerializeContext.h>
  11. #include "${Name}EditorSystemComponent.h"
  12. #include <${Name}/${Name}TypeIds.h>
  13. namespace ${SanitizedCppName}
  14. {
  15. AZ_COMPONENT_IMPL(${SanitizedCppName}EditorSystemComponent, "${SanitizedCppName}EditorSystemComponent",
  16. ${SanitizedCppName}EditorSystemComponentTypeId, BaseSystemComponent);
  17. void ${SanitizedCppName}EditorSystemComponent::Reflect(AZ::ReflectContext* context)
  18. {
  19. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  20. {
  21. serializeContext->Class<${SanitizedCppName}EditorSystemComponent, ${SanitizedCppName}SystemComponent>()
  22. ->Version(0);
  23. }
  24. }
  25. ${SanitizedCppName}EditorSystemComponent::${SanitizedCppName}EditorSystemComponent() = default;
  26. ${SanitizedCppName}EditorSystemComponent::~${SanitizedCppName}EditorSystemComponent() = default;
  27. void ${SanitizedCppName}EditorSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
  28. {
  29. BaseSystemComponent::GetProvidedServices(provided);
  30. provided.push_back(AZ_CRC_CE("${SanitizedCppName}EditorService"));
  31. }
  32. void ${SanitizedCppName}EditorSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
  33. {
  34. BaseSystemComponent::GetIncompatibleServices(incompatible);
  35. incompatible.push_back(AZ_CRC_CE("${SanitizedCppName}EditorService"));
  36. }
  37. void ${SanitizedCppName}EditorSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
  38. {
  39. BaseSystemComponent::GetRequiredServices(required);
  40. }
  41. void ${SanitizedCppName}EditorSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
  42. {
  43. BaseSystemComponent::GetDependentServices(dependent);
  44. }
  45. void ${SanitizedCppName}EditorSystemComponent::Activate()
  46. {
  47. ${SanitizedCppName}SystemComponent::Activate();
  48. AzToolsFramework::EditorEvents::Bus::Handler::BusConnect();
  49. }
  50. void ${SanitizedCppName}EditorSystemComponent::Deactivate()
  51. {
  52. AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect();
  53. ${SanitizedCppName}SystemComponent::Deactivate();
  54. }
  55. } // namespace ${SanitizedCppName}