ImageBasedLightComponent.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 <ImageBasedLights/ImageBasedLightComponent.h>
  9. #include <AzCore/RTTI/BehaviorContext.h>
  10. namespace AZ
  11. {
  12. namespace Render
  13. {
  14. ImageBasedLightComponent::ImageBasedLightComponent(const ImageBasedLightComponentConfig& config)
  15. : BaseClass(config)
  16. {
  17. }
  18. void ImageBasedLightComponent::Reflect(AZ::ReflectContext* context)
  19. {
  20. BaseClass::Reflect(context);
  21. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  22. {
  23. serializeContext->Class<ImageBasedLightComponent, BaseClass>()
  24. ->Version(0)
  25. ;
  26. }
  27. if (auto behaviorContext = azrtti_cast<BehaviorContext*>(context))
  28. {
  29. behaviorContext->Class<ImageBasedLightComponent>()->RequestBus("ImageBasedLightComponentRequestBus");
  30. behaviorContext->ConstantProperty("ImageBasedLightComponentTypeId", BehaviorConstant(Uuid(ImageBasedLightComponentTypeId)))
  31. ->Attribute(AZ::Script::Attributes::Module, "render")
  32. ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common);
  33. }
  34. }
  35. } // namespace Render
  36. } // namespace AZ