浏览代码

fixed missing methods in SC from Trigger and Collision events (#1185)

amzn-sean 4 年之前
父节点
当前提交
47e5c72f2e
共有 1 个文件被更改,包括 9 次插入7 次删除
  1. 9 7
      Code/Framework/AzFramework/AzFramework/Physics/Collision/CollisionEvents.cpp

+ 9 - 7
Code/Framework/AzFramework/AzFramework/Physics/Collision/CollisionEvents.cpp

@@ -37,9 +37,10 @@ namespace AzPhysics
         if (auto* behaviorContext = azdynamic_cast<AZ::BehaviorContext*>(context))
         if (auto* behaviorContext = azdynamic_cast<AZ::BehaviorContext*>(context))
         {
         {
             behaviorContext->Class<TriggerEvent>()
             behaviorContext->Class<TriggerEvent>()
-                ->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<AZ::BehaviorContext*>(context))
         if (auto* behaviorContext = azdynamic_cast<AZ::BehaviorContext*>(context))
         {
         {
             behaviorContext->Class<CollisionEvent>()
             behaviorContext->Class<CollisionEvent>()
-                ->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)
                 ;
                 ;
         }
         }
     }
     }