DecalComponent.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 <Decals/DecalComponent.h>
  9. namespace AZ
  10. {
  11. namespace Render
  12. {
  13. DecalComponent::DecalComponent(const DecalComponentConfig& config)
  14. : BaseClass(config)
  15. {
  16. }
  17. void DecalComponent::Reflect(AZ::ReflectContext* context)
  18. {
  19. BaseClass::Reflect(context);
  20. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  21. {
  22. serializeContext->Class<DecalComponent, BaseClass>();
  23. }
  24. if (auto behaviorContext = azrtti_cast<BehaviorContext*>(context))
  25. {
  26. behaviorContext->Class<DecalComponent>()->RequestBus("DecalRequestBus");
  27. behaviorContext->ConstantProperty("DecalComponentTypeId", BehaviorConstant(Uuid(DecalComponentTypeId)))
  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