Paper_KidSystemComponent.cpp 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 <AzCore/Serialization/SerializeContext.h>
  9. #include <AzCore/Serialization/EditContext.h>
  10. #include <AzCore/Serialization/EditContextConstants.inl>
  11. #include "Paper_KidSystemComponent.h"
  12. namespace Paper_Kid
  13. {
  14. void Paper_KidSystemComponent::Reflect(AZ::ReflectContext* context)
  15. {
  16. if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
  17. {
  18. serialize->Class<Paper_KidSystemComponent, AZ::Component>()
  19. ->Version(0)
  20. ;
  21. if (AZ::EditContext* ec = serialize->GetEditContext())
  22. {
  23. ec->Class<Paper_KidSystemComponent>("Paper_Kid", "[Description of functionality provided by this System Component]")
  24. ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
  25. ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System"))
  26. ->Attribute(AZ::Edit::Attributes::AutoExpand, true)
  27. ;
  28. }
  29. }
  30. }
  31. void Paper_KidSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
  32. {
  33. provided.push_back(AZ_CRC("Paper_KidService"));
  34. }
  35. void Paper_KidSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
  36. {
  37. incompatible.push_back(AZ_CRC("Paper_KidService"));
  38. }
  39. void Paper_KidSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
  40. {
  41. }
  42. void Paper_KidSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
  43. {
  44. }
  45. Paper_KidSystemComponent::Paper_KidSystemComponent()
  46. {
  47. if (Paper_KidInterface::Get() == nullptr)
  48. {
  49. Paper_KidInterface::Register(this);
  50. }
  51. }
  52. Paper_KidSystemComponent::~Paper_KidSystemComponent()
  53. {
  54. if (Paper_KidInterface::Get() == this)
  55. {
  56. Paper_KidInterface::Unregister(this);
  57. }
  58. }
  59. void Paper_KidSystemComponent::Init()
  60. {
  61. }
  62. void Paper_KidSystemComponent::Activate()
  63. {
  64. Paper_KidRequestBus::Handler::BusConnect();
  65. }
  66. void Paper_KidSystemComponent::Deactivate()
  67. {
  68. Paper_KidRequestBus::Handler::BusDisconnect();
  69. }
  70. }