SimulationManagerEditor.cpp 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 "SimulationManagerEditor.h"
  9. #include <AzCore/Serialization/SerializeContext.h>
  10. #include <SimulationInterfaces/SimulationInterfacesTypeIds.h>
  11. namespace SimulationInterfaces
  12. {
  13. AZ_COMPONENT_IMPL(SimulationManagerEditor, "SimulationMangerEditor", SimulationManagerEditorTypeId, BaseSystemComponent);
  14. void SimulationManagerEditor::Reflect(AZ::ReflectContext* context)
  15. {
  16. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  17. {
  18. serializeContext->Class<SimulationManagerEditor, SimulationManager>()->Version(0);
  19. }
  20. }
  21. SimulationManagerEditor::SimulationManagerEditor() = default;
  22. SimulationManagerEditor::~SimulationManagerEditor() = default;
  23. void SimulationManagerEditor::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
  24. {
  25. BaseSystemComponent::GetProvidedServices(provided);
  26. provided.push_back(AZ_CRC_CE("SimulationManagerEditorService"));
  27. }
  28. void SimulationManagerEditor::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
  29. {
  30. BaseSystemComponent::GetIncompatibleServices(incompatible);
  31. incompatible.push_back(AZ_CRC_CE("SimulationManagerEditorService"));
  32. }
  33. void SimulationManagerEditor::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
  34. {
  35. BaseSystemComponent::GetRequiredServices(required);
  36. required.push_back(AZ_CRC_CE("SimulationFeaturesAggregatorEditorService"));
  37. }
  38. void SimulationManagerEditor::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
  39. {
  40. BaseSystemComponent::GetDependentServices(dependent);
  41. dependent.push_back(AZ_CRC_CE("SimulationFeaturesAggregatorEditorService"));
  42. }
  43. void SimulationManagerEditor::Init()
  44. {
  45. BaseSystemComponent::Init();
  46. }
  47. void SimulationManagerEditor::Activate()
  48. {
  49. AzToolsFramework::EditorEvents::Bus::Handler::BusConnect();
  50. AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect();
  51. }
  52. void SimulationManagerEditor::Deactivate()
  53. {
  54. AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
  55. AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect();
  56. BaseSystemComponent::Deactivate();
  57. }
  58. void SimulationManagerEditor::OnStartPlayInEditorBegin()
  59. {
  60. BaseSystemComponent::Activate();
  61. }
  62. } // namespace SimulationInterfaces