SimulationManagerEditor.cpp 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. }
  57. void SimulationManagerEditor::OnStartPlayInEditorBegin()
  58. {
  59. BaseSystemComponent::Activate();
  60. }
  61. void SimulationManagerEditor::OnStopPlayInEditor()
  62. {
  63. BaseSystemComponent::Deactivate();
  64. }
  65. } // namespace SimulationInterfaces