Class ARParticipantManager
A manager for ARParticipants. Creates, updates, and removes
GameObject
s in response to other users in a multi-user collaborative session.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Assembly: Unity.XR.ARFoundation.dll
Syntax
[DefaultExecutionOrder(-2147483647)]
[DisallowMultipleComponent]
[RequireComponent(typeof(XROrigin))]
[AddComponentMenu("XR/AR Foundation/AR Participant Manager")]
public sealed class ARParticipantManager : ARTrackableManager<XRParticipantSubsystem, XRParticipantSubsystemDescriptor, XRParticipantSubsystem.Provider, XRParticipant, ARParticipant>, ITrackablesChanged<ARParticipant>
Remarks
Related information: AR Participant Manager component
Properties
gameObjectName
The name to be used for the GameObject
whenever a new participant is detected.
Declaration
protected override string gameObjectName { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
participantPrefab
(Optional) Instantiates this Prefab for each participant. If null
, an empty GameObject
with a ARParticipant component is instantiated instead.
Declaration
public GameObject participantPrefab { get; set; }
Property Value
Type | Description |
---|---|
GameObject |
Methods
GetParticipant(TrackableId)
Attempt to retrieve an existing ARParticipant by trackableId
.
Declaration
public ARParticipant GetParticipant(TrackableId trackableId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableId | The TrackableId of the participant to retrieve. |
Returns
Type | Description |
---|---|
ARParticipant | The ARParticipant with |
GetPrefab()
The Prefab which will be instantiated for each ARParticipant. Can be null
.
Declaration
protected override GameObject GetPrefab()
Returns
Type | Description |
---|---|
GameObject | A Prefab to instantiate for each ARParticipant. |
Overrides
OnTrackablesChanged(List<ARParticipant>, List<ARParticipant>, List<ARParticipant>)
Invoked when the base class detects trackable changes.
Declaration
[Obsolete("OnTrackablesChanged() has been deprecated in AR Foundation version 6.0.", false)]
protected override void OnTrackablesChanged(List<ARParticipant> added, List<ARParticipant> updated, List<ARParticipant> removed)
Parameters
Type | Name | Description |
---|---|---|
List<ARParticipant> | added | The list of added ARParticipants. |
List<ARParticipant> | updated | The list of updated ARParticipants. |
List<ARParticipant> | removed | The list of removed ARParticipants. |
Overrides
Events
participantsChanged
Invoked when participants have changed (been added, updated, or removed).
Declaration
[Obsolete("participantsChanged has been deprecated in AR Foundation version 6.0. Use trackablesChanged instead.", false)]
public event Action<ARParticipantsChangedEventArgs> participantsChanged
Event Type
Type | Description |
---|---|
Action<ARParticipantsChangedEventArgs> |