StarsSystemComponent.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 <StarsSystemComponent.h>
  9. #include <AzCore/Serialization/SerializeContext.h>
  10. #include <StarsAsset.h>
  11. #include <StarsFeatureProcessor.h>
  12. namespace AZ::Render
  13. {
  14. void StarsSystemComponent::Reflect(AZ::ReflectContext* context)
  15. {
  16. StarsFeatureProcessor::Reflect(context);
  17. if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
  18. {
  19. serialize->Class<StarsSystemComponent, AZ::Component>()
  20. ->Version(0)
  21. ;
  22. }
  23. }
  24. void StarsSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
  25. {
  26. provided.push_back(AZ_CRC_CE("StarsSystemService"));
  27. }
  28. void StarsSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
  29. {
  30. incompatible.push_back(AZ_CRC_CE("StarsSystemService"));
  31. }
  32. void StarsSystemComponent::Activate()
  33. {
  34. m_starsAssetHandler = aznew AZ::Render::StarsAssetHandler();
  35. m_starsAssetHandler->Register();
  36. }
  37. void StarsSystemComponent::Deactivate()
  38. {
  39. m_starsAssetHandler->Unregister();
  40. delete m_starsAssetHandler;
  41. }
  42. } // namespace Stars