LevelManagerEditor.cpp 2.7 KB

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