Class IUsesBodyTrackingMethods
Namespace: Unity.MARS.Providers
Syntax
public static class IUsesBodyTrackingMethods : object
Methods
GetBodies(IUsesBodyTracking, List<MRBody>)
Get the currently tracked bodies
Declaration
public static void GetBodies(this IUsesBodyTracking obj, List<MRBody> bodies)
Parameters
Type | Name | Description |
---|---|---|
IUsesBodyTracking | obj | |
List<MRBody> | bodies | A list of MRRect objects to which the currently tracked planes will be added |
SubscribeBodyAdded(IUsesBodyTracking, Action<MRBody>)
Subscribe to the bodyAdded event, which is called whenever a body becomes tracked for the first time
Declaration
public static void SubscribeBodyAdded(this IUsesBodyTracking obj, Action<MRBody> bodyAdded)
Parameters
Type | Name | Description |
---|---|---|
IUsesBodyTracking | obj | |
Action<MRBody> | bodyAdded | The delegate to subscribe |
SubscribeBodyRemoved(IUsesBodyTracking, Action<MRBody>)
Subscribe to the bodyRemoved event, which is called whenever a tracked body is removed (lost)
Declaration
public static void SubscribeBodyRemoved(this IUsesBodyTracking obj, Action<MRBody> bodyRemoved)
Parameters
Type | Name | Description |
---|---|---|
IUsesBodyTracking | obj | |
Action<MRBody> | bodyRemoved | The delegate to subscribe |
SubscribeBodyUpdated(IUsesBodyTracking, Action<MRBody>)
Subscribe to the bodyUpdated event, which is called when a tracked body has updated data
Declaration
public static void SubscribeBodyUpdated(this IUsesBodyTracking obj, Action<MRBody> bodyUpdated)
Parameters
Type | Name | Description |
---|---|---|
IUsesBodyTracking | obj | |
Action<MRBody> | bodyUpdated | The delegate to subscribe |
TrackBody(IUsesBodyTracking, Vector2)
Track body at specified position
Declaration
public static void TrackBody(this IUsesBodyTracking obj, Vector2 center)
Parameters
Type | Name | Description |
---|---|---|
IUsesBodyTracking | obj | |
Vector2 | center | The position (center) at which to track a body |
UnsubscribeBodyAdded(IUsesBodyTracking, Action<MRBody>)
Unsubscribe a delegate from the bodyAdded event
Declaration
public static void UnsubscribeBodyAdded(this IUsesBodyTracking obj, Action<MRBody> bodyAdded)
Parameters
Type | Name | Description |
---|---|---|
IUsesBodyTracking | obj | |
Action<MRBody> | bodyAdded | The delegate to unsubscribe |
UnsubscribeBodyRemoved(IUsesBodyTracking, Action<MRBody>)
Unsubscribe a delegate from the bodyRemoved event
Declaration
public static void UnsubscribeBodyRemoved(this IUsesBodyTracking obj, Action<MRBody> bodyRemoved)
Parameters
Type | Name | Description |
---|---|---|
IUsesBodyTracking | obj | |
Action<MRBody> | bodyRemoved | The delegate to unsubscribe |
UnsubscribeBodyUpdated(IUsesBodyTracking, Action<MRBody>)
Unsubscribe a delegate from the bodyUpdated event
Declaration
public static void UnsubscribeBodyUpdated(this IUsesBodyTracking obj, Action<MRBody> bodyUpdated)
Parameters
Type | Name | Description |
---|---|---|
IUsesBodyTracking | obj | |
Action<MRBody> | bodyUpdated | The delegate to unsubscribe |