AreaLightComponent.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 <CoreLights/AreaLightComponent.h>
  9. namespace AZ
  10. {
  11. namespace Render
  12. {
  13. AreaLightComponent::AreaLightComponent(const AreaLightComponentConfig& config)
  14. : BaseClass(config)
  15. {
  16. }
  17. void AreaLightComponent::Reflect(AZ::ReflectContext* context)
  18. {
  19. BaseClass::Reflect(context);
  20. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  21. {
  22. serializeContext->Class<AreaLightComponent, BaseClass>();
  23. }
  24. if (auto behaviorContext = azrtti_cast<BehaviorContext*>(context))
  25. {
  26. behaviorContext->Class<AreaLightComponent>()->RequestBus("AreaLightRequestBus");
  27. behaviorContext->ConstantProperty("AreaLightComponentTypeId", BehaviorConstant(Uuid(AreaLightComponentTypeId)))
  28. ->Attribute(AZ::Script::Attributes::Module, "render")
  29. ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common);
  30. }
  31. }
  32. } // namespace Render
  33. } // namespace AZ