1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- /*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
- #include "RecastNavigationMeshComponent.h"
- #include <AzCore/Serialization/SerializeContext.h>
- namespace RecastNavigation
- {
- RecastNavigationMeshComponent::RecastNavigationMeshComponent(const RecastNavigationMeshConfig& config)
- : BaseClass(config)
- {
- }
- void RecastNavigationMeshComponent::Reflect(AZ::ReflectContext* context)
- {
- BaseClass::Reflect(context);
- if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
- {
- serializeContext->Class<RecastNavigationMeshComponent, BaseClass>()
- ->Version(1);
- }
- if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
- {
- behaviorContext->ConstantProperty("RecastNavigationMeshComponentTypeId", BehaviorConstant(AZ::Uuid(RecastNavigationMeshComponentTypeId)))
- ->Attribute(AZ::Script::Attributes::Module, "navigation")
- ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common);
- behaviorContext->EBus<RecastNavigationMeshRequestBus>("RecastNavigationMeshRequestBus")
- ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
- ->Attribute(AZ::Script::Attributes::Module, "navigation")
- ->Attribute(AZ::Script::Attributes::Category, "Recast Navigation")
- ->Event("UpdateNavigationMesh", &RecastNavigationMeshRequests::UpdateNavigationMeshBlockUntilCompleted)
- ->Event("UpdateNavigationMeshAsync", &RecastNavigationMeshRequests::UpdateNavigationMeshAsync);
- behaviorContext->Class<RecastNavigationMeshComponentController>()->RequestBus("RecastNavigationMeshRequestBus");
- behaviorContext->EBus<RecastNavigationMeshNotificationBus>("RecastNavigationMeshNotificationBus")
- ->Handler<RecastNavigationNotificationHandler>();
- }
- }
- } // namespace RecastNavigation
|