3
0

${Name}EditorSystemComponent.cpp 2.3 KB

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