Class ARFaceManager
Creates, updates, and removes GameObject
s with ARFace components under the ARSessionOrigin's trackablesParent.
Inheritance
System.Object
ARFaceManager
Namespace: UnityEngine.XR.ARFoundation
Syntax
public sealed class ARFaceManager : MonoBehaviour
Remarks
When enabled, this component subscribes to faceAdded, faceUpdated, and faceRemoved. If this component is disabled, and there are no other subscribers to those events, face detection will be disabled on the device.
Properties
faceCount
Get the number of faces managed by this manager.
Declaration
public int faceCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
facePrefab
Getter/setter for the Face Prefab.
Declaration
public GameObject facePrefab { get; set; }
Property Value
Type | Description |
---|---|
GameObject |
Methods
GetAllFaces(List<ARFace>)
Get all currently tracked ARFaces.
Declaration
public void GetAllFaces(List<ARFace> faces)
Parameters
Type | Name | Description |
---|---|---|
List<ARFace> | faces | Replaces the contents with the current list of faces. |
TryGetFace(TrackableId)
Attempts to retrieve an ARFace.
Declaration
public ARFace TryGetFace(TrackableId faceId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | faceId | The |
Returns
Type | Description |
---|---|
ARFace | The ARFaceif found. |
Events
faceAdded
Raised for each new ARFace detected in the environment.
Declaration
public event Action<ARFaceAddedEventArgs> faceAdded
Event Type
Type | Description |
---|---|
Action<ARFaceAddedEventArgs> |
faceRemoved
Raised whenever an ARFace is removed.
Declaration
public event Action<ARFaceRemovedEventArgs> faceRemoved
Event Type
Type | Description |
---|---|
Action<ARFaceRemovedEventArgs> |
faceUpdated
Raised for each ARFace every time it updates.
Declaration
public event Action<ARFaceUpdatedEventArgs> faceUpdated
Event Type
Type | Description |
---|---|
Action<ARFaceUpdatedEventArgs> |