ROS2EditorCameraSystemComponent.cpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 "ROS2EditorCameraSystemComponent.h"
  9. #include <AzCore/Component/ComponentApplicationBus.h>
  10. #include <AzCore/Serialization/SerializeContext.h>
  11. namespace ROS2
  12. {
  13. void ROS2EditorCameraSystemComponent::Reflect(AZ::ReflectContext* context)
  14. {
  15. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  16. {
  17. serializeContext->Class<ROS2EditorCameraSystemComponent, BaseSystemComponent>()->Version(0);
  18. }
  19. }
  20. void ROS2EditorCameraSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
  21. {
  22. BaseSystemComponent::GetProvidedServices(provided);
  23. provided.push_back(AZ_CRC_CE("ROS2EditorCameraSystemService"));
  24. }
  25. void ROS2EditorCameraSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
  26. {
  27. BaseSystemComponent::GetIncompatibleServices(incompatible);
  28. incompatible.push_back(AZ_CRC_CE("ROS2EditorCameraSystemService"));
  29. }
  30. void ROS2EditorCameraSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
  31. {
  32. BaseSystemComponent::GetRequiredServices(required);
  33. }
  34. void ROS2EditorCameraSystemComponent::Activate()
  35. {
  36. AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect();
  37. BaseSystemComponent::Activate();
  38. }
  39. void ROS2EditorCameraSystemComponent::Deactivate()
  40. {
  41. AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
  42. }
  43. void ROS2EditorCameraSystemComponent::OnStartPlayInEditorBegin()
  44. {
  45. BaseSystemComponent::Activate();
  46. }
  47. void ROS2EditorCameraSystemComponent::OnStopPlayInEditor()
  48. {
  49. BaseSystemComponent::Deactivate();
  50. }
  51. } // namespace ROS2