3
0

DirectionalLightComponent.cpp 1.4 KB

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