using System;
using Unity.Collections;
using UnityEngine.SubsystemsImplementation;
namespace UnityEngine.XR.ARSubsystems
{
///
/// Subsystem for managing the participants in a multi-user collaborative session.
///
public class XRParticipantSubsystem
: TrackingSubsystem
{
///
/// Do not call this directly. Call create on a valid instead.
///
public XRParticipantSubsystem() { }
///
/// Get the changed participants (added, updated, and removed) since the last call to .
///
/// An Allocator to use when allocating the returned NativeArrays.
///
/// that describes the participants that have been added, updated, and removed
/// since the last call to . The caller owns the memory allocated with Allocator.
///
public override TrackableChanges GetChanges(Allocator allocator)
{
var changes = provider.GetChanges(XRParticipant.defaultParticipant, allocator);
#if DEVELOPMENT_BUILD || UNITY_EDITOR
m_ValidationUtility.ValidateAndDisposeIfThrown(changes);
#endif
return changes;
}
///
/// The API this subsystem uses to interact with different provider implementations.
///
public abstract class Provider : SubsystemProvider
{
///
/// Get the changed participants (added, updated, and removed) since the last call to
/// .
///
///
/// The default participant. This should be used to initialize the returned NativeArrays for backwards compatibility.
/// See .
///
/// An Allocator to use when allocating the returned NativeArrays.
///
/// that describes the participants that have been added, updated, and removed
/// since the last call to . The changes should be allocated using
/// .
///
public abstract TrackableChanges GetChanges(
XRParticipant defaultParticipant,
Allocator allocator);
}
#if DEVELOPMENT_BUILD || UNITY_EDITOR
ValidationUtility m_ValidationUtility = new ValidationUtility();
#endif
}
}