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