MPS-Asset-TestSystemComponent.cpp 2.4 KB

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