DebugSystemComponent.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 "DebugSystemComponent.h"
  9. #include <AzCore/Serialization/EditContext.h>
  10. #include <AzCore/Serialization/SerializeContext.h>
  11. #include <CrySystemBus.h>
  12. namespace Vegetation
  13. {
  14. void DebugSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services)
  15. {
  16. services.push_back(AZ_CRC("VegetationDebugSystemService", 0x8cac3d67));
  17. }
  18. void DebugSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& services)
  19. {
  20. services.push_back(AZ_CRC("VegetationDebugSystemService", 0x8cac3d67));
  21. }
  22. void DebugSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& services)
  23. {
  24. }
  25. void DebugSystemComponent::Reflect(AZ::ReflectContext* context)
  26. {
  27. if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
  28. {
  29. serialize->Class<DebugSystemComponent, AZ::Component>()
  30. ->Version(0)
  31. ;
  32. if (AZ::EditContext* editContext = serialize->GetEditContext())
  33. {
  34. editContext->Class<DebugSystemComponent>("Vegetation Debug System", "Stores and manages vegetation debug data")
  35. ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
  36. ->Attribute(AZ::Edit::Attributes::Category, "Vegetation")
  37. ->Attribute(AZ::Edit::Attributes::AutoExpand, true)
  38. ;
  39. }
  40. }
  41. }
  42. DebugSystemComponent::DebugSystemComponent()
  43. {
  44. }
  45. DebugSystemComponent::~DebugSystemComponent()
  46. {
  47. }
  48. Vegetation::DebugData* DebugSystemComponent::GetDebugData()
  49. {
  50. return &m_debugData;
  51. }
  52. void DebugSystemComponent::Activate()
  53. {
  54. DebugSystemDataBus::Handler::BusConnect();
  55. }
  56. void DebugSystemComponent::Deactivate()
  57. {
  58. DebugSystemDataBus::Handler::BusDisconnect();
  59. }
  60. }