From 47e5c72f2e0a5e036ce367053e691fe4d2ebc00c Mon Sep 17 00:00:00 2001 From: amzn-sean <75276488+amzn-sean@users.noreply.github.com> Date: Tue, 8 Jun 2021 18:20:34 +0100 Subject: [PATCH] fixed missing methods in SC from Trigger and Collision events (#1185) --- .../Physics/Collision/CollisionEvents.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Collision/CollisionEvents.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Collision/CollisionEvents.cpp index 4c9124f594..9f9e5c51ad 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Collision/CollisionEvents.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Collision/CollisionEvents.cpp @@ -37,9 +37,10 @@ namespace AzPhysics if (auto* behaviorContext = azdynamic_cast(context)) { behaviorContext->Class() - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Method("GetTriggerEntityId", &TriggerEvent::GetTriggerEntityId) - ->Method("GetOtherEntityId", &TriggerEvent::GetOtherEntityId) + ->Attribute(AZ::Script::Attributes::Module, "physics") + ->Attribute(AZ::Script::Attributes::Category, "Physics") + ->Method("Get Trigger EntityId", &TriggerEvent::GetTriggerEntityId) + ->Method("Get Other EntityId", &TriggerEvent::GetOtherEntityId) ; } } @@ -104,10 +105,11 @@ namespace AzPhysics if (auto* behaviorContext = azdynamic_cast(context)) { behaviorContext->Class() - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Property("Contacts", BehaviorValueProperty(&CollisionEvent::m_contacts)) - ->Method("GetBody1EntityId", &CollisionEvent::GetBody1EntityId) - ->Method("GetBody2EntityId", &CollisionEvent::GetBody2EntityId) + ->Attribute(AZ::Script::Attributes::Module, "physics") + ->Attribute(AZ::Script::Attributes::Category, "Physics") + ->Property("Contacts", BehaviorValueGetter(&CollisionEvent::m_contacts), nullptr) + ->Method("Get Body 1 EntityId", &CollisionEvent::GetBody1EntityId) + ->Method("Get Body 2 EntityId", &CollisionEvent::GetBody2EntityId) ; } }