Class IUsesMarkerTrackingMethods
Namespace: Unity.MARS
Syntax
public static class IUsesMarkerTrackingMethods
Methods
GetMarkers(IUsesMarkerTracking, List<MRMarker>)
Get the currently tracked markers
Declaration
public static void GetMarkers(this IUsesMarkerTracking obj, List<MRMarker> markers)
Parameters
Type | Name | Description |
---|---|---|
IUsesMarkerTracking | obj | |
List<MRMarker> | markers | A list of MRMarker objects to which the currently tracked markers will be added |
SetActiveMarkerLibrary(IUsesMarkerTracking, IMRMarkerLibrary)
Declaration
public static bool SetActiveMarkerLibrary(this IUsesMarkerTracking obj, IMRMarkerLibrary markerLibrary)
Parameters
Type | Name | Description |
---|---|---|
IUsesMarkerTracking | obj | |
IMRMarkerLibrary | markerLibrary |
Returns
Type | Description |
---|---|
Boolean |
StartTrackingMarkers(IUsesMarkerTracking)
Start tracking markers. Marker tracking is enabled on initialization, so this is only necessary after calling StopTrackingMarkers.
Declaration
public static void StartTrackingMarkers(this IUsesMarkerTracking obj)
Parameters
Type | Name | Description |
---|---|---|
IUsesMarkerTracking | obj |
StopTrackingMarkers(IUsesMarkerTracking)
Stop tracking markers. This will happen automatically on destroying the session. It is only necessary to call this method to pause marker tracking while maintaining camera tracking
Declaration
public static void StopTrackingMarkers(this IUsesMarkerTracking obj)
Parameters
Type | Name | Description |
---|---|---|
IUsesMarkerTracking | obj |
SubscribeMarkerAdded(IUsesMarkerTracking, Action<MRMarker>)
Subscribe to the markerAdded event, which is called when a marker becomes tracked for the first time
Declaration
public static void SubscribeMarkerAdded(this IUsesMarkerTracking obj, Action<MRMarker> markerAdded)
Parameters
Type | Name | Description |
---|---|---|
IUsesMarkerTracking | obj | |
Action<MRMarker> | markerAdded | The delegate to subscribe |
SubscribeMarkerRemoved(IUsesMarkerTracking, Action<MRMarker>)
Subscribe to the markerRemoved event, which is called when a tracked marker is removed (lost)
Declaration
public static void SubscribeMarkerRemoved(this IUsesMarkerTracking obj, Action<MRMarker> markerRemoved)
Parameters
Type | Name | Description |
---|---|---|
IUsesMarkerTracking | obj | |
Action<MRMarker> | markerRemoved | The delegate to subscribe |
SubscribeMarkerUpdated(IUsesMarkerTracking, Action<MRMarker>)
Subscribe to the markerUpdated event, which is called when a tracked marker has updated data
Declaration
public static void SubscribeMarkerUpdated(this IUsesMarkerTracking obj, Action<MRMarker> markerUpdated)
Parameters
Type | Name | Description |
---|---|---|
IUsesMarkerTracking | obj | |
Action<MRMarker> | markerUpdated | The delegate to subscribe |
UnsubscribeMarkerAdded(IUsesMarkerTracking, Action<MRMarker>)
Unsubscribe from the markerAdded event, which is called when a marker becomes tracked for the first time
Declaration
public static void UnsubscribeMarkerAdded(this IUsesMarkerTracking obj, Action<MRMarker> markerAdded)
Parameters
Type | Name | Description |
---|---|---|
IUsesMarkerTracking | obj | |
Action<MRMarker> | markerAdded | The delegate to unsubscribe |
UnsubscribeMarkerRemoved(IUsesMarkerTracking, Action<MRMarker>)
Unsubscribe from the markerRemoved event, which is called when a tracked marker is removed (lost)
Declaration
public static void UnsubscribeMarkerRemoved(this IUsesMarkerTracking obj, Action<MRMarker> markerRemoved)
Parameters
Type | Name | Description |
---|---|---|
IUsesMarkerTracking | obj | |
Action<MRMarker> | markerRemoved | The delegate to unsubscribe |
UnsubscribeMarkerUpdated(IUsesMarkerTracking, Action<MRMarker>)
Unsubscribe from the markerUpdated event, which is called when a tracked marker has updated data
Declaration
public static void UnsubscribeMarkerUpdated(this IUsesMarkerTracking obj, Action<MRMarker> markerUpdated)
Parameters
Type | Name | Description |
---|---|---|
IUsesMarkerTracking | obj | |
Action<MRMarker> | markerUpdated | The delegate to unsubscribe |