Class ARParticipantManager
A manager for ARParticipants. Creates, updates, and removes
GameObject
s in response to other users in a multi-user collaborative session.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Syntax
[DefaultExecutionOrder(-2147483647)]
[DisallowMultipleComponent]
[RequireComponent(typeof(ARSessionOrigin))]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.1/api/UnityEngine.XR.ARFoundation.ARParticipantManager.html")]
public sealed class ARParticipantManager : ARTrackableManager<XRParticipantSubsystem, XRParticipantSubsystemDescriptor, XRParticipant, ARParticipant>
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. May 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
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
public event Action<ARParticipantsChangedEventArgs> participantsChanged
Event Type
Type | Description |
---|---|
Action<ARParticipantsChangedEventArgs> |