RecastNavigationPhysXProviderComponent.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 "RecastNavigationPhysXProviderComponent.h"
  9. #include <AzCore/Debug/Budget.h>
  10. #include <AzCore/RTTI/BehaviorContext.h>
  11. #include <AzCore/Serialization/SerializeContext.h>
  12. #include <LmbrCentral/Shape/ShapeComponentBus.h>
  13. AZ_DECLARE_BUDGET(Navigation);
  14. namespace RecastNavigation
  15. {
  16. RecastNavigationPhysXProviderComponent::RecastNavigationPhysXProviderComponent(const RecastNavigationPhysXProviderConfig& config)
  17. : BaseClass(config)
  18. {
  19. }
  20. void RecastNavigationPhysXProviderComponent::Reflect(AZ::ReflectContext* context)
  21. {
  22. BaseClass::Reflect(context);
  23. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  24. {
  25. serializeContext->Class<RecastNavigationPhysXProviderComponent, BaseClass>()
  26. ->Version(1);
  27. }
  28. if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
  29. {
  30. behaviorContext->ConstantProperty("RecastNavigationPhysXProviderComponentTypeId",
  31. BehaviorConstant(AZ::Uuid(RecastNavigationPhysXProviderComponentTypeId)))
  32. ->Attribute(AZ::Script::Attributes::Module, "navigation")
  33. ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common);
  34. behaviorContext->Class<RecastNavigationPhysXProviderComponent>()->RequestBus("RecastNavigationProviderRequestBus");
  35. }
  36. }
  37. } // namespace RecastNavigation