CommonFeaturesSystemComponent.cpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 <CommonFeaturesSystemComponent.h>
  9. #include <AzCore/Serialization/SerializeContext.h>
  10. #include <AzCore/Serialization/EditContext.h>
  11. #include <AzCore/Serialization/EditContextConstants.inl>
  12. #include <Atom/RPI.Reflect/Model/ModelAsset.h>
  13. #include <AtomLyIntegration/CommonFeatures/CoreLights/CoreLightsConstants.h>
  14. #include <AtomLyIntegration/CommonFeatures/Mesh/MeshComponentConstants.h>
  15. namespace AZ
  16. {
  17. namespace Render
  18. {
  19. void AtomLyIntegrationCommonFeaturesSystemComponent::Reflect(ReflectContext* context)
  20. {
  21. if (SerializeContext* serialize = azrtti_cast<SerializeContext*>(context))
  22. {
  23. serialize->Class<AtomLyIntegrationCommonFeaturesSystemComponent, Component>()
  24. ->Version(0);
  25. if (AZ::EditContext* ec = serialize->GetEditContext())
  26. {
  27. ec->Class<AtomLyIntegrationCommonFeaturesSystemComponent>("Common", "[Description of functionality provided by this System Component]")
  28. ->ClassElement(Edit::ClassElements::EditorData, "")
  29. ->Attribute(Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b))
  30. ->Attribute(Edit::Attributes::AutoExpand, true)
  31. ;
  32. }
  33. }
  34. CoreLightConstantsReflect(context);
  35. }
  36. void AtomLyIntegrationCommonFeaturesSystemComponent::GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided)
  37. {
  38. provided.push_back(AZ_CRC("LyIntegrationCommonFeaturesService", 0x9083ee7d));
  39. }
  40. void AtomLyIntegrationCommonFeaturesSystemComponent::GetIncompatibleServices(ComponentDescriptor::DependencyArrayType& incompatible)
  41. {
  42. incompatible.push_back(AZ_CRC("LyIntegrationCommonFeaturesService", 0x9083ee7d));
  43. }
  44. void AtomLyIntegrationCommonFeaturesSystemComponent::GetRequiredServices(ComponentDescriptor::DependencyArrayType& required)
  45. {
  46. required.push_back(AZ_CRC("CommonService", 0x6398eec4));
  47. }
  48. void AtomLyIntegrationCommonFeaturesSystemComponent::GetDependentServices(ComponentDescriptor::DependencyArrayType& dependent)
  49. {
  50. AZ_UNUSED(dependent);
  51. }
  52. void AtomLyIntegrationCommonFeaturesSystemComponent::Init()
  53. {
  54. }
  55. void AtomLyIntegrationCommonFeaturesSystemComponent::Activate()
  56. {
  57. auto modelAssetHandler = azrtti_cast<RPI::ModelAssetHandler*>(Data::AssetManager::Instance().GetHandler(azrtti_typeid<RPI::ModelAsset>()));
  58. modelAssetHandler->m_componentTypeId = EditorMeshComponentTypeId;
  59. }
  60. void AtomLyIntegrationCommonFeaturesSystemComponent::Deactivate()
  61. {
  62. }
  63. } // namespace Render
  64. } // namespace AZ