using System;
using UnityEngine.SubsystemsImplementation;
namespace UnityEngine.XR.ARSubsystems
{
///
/// The descriptor of the that shows which features are available on that XRSubsystem.
///
///
/// Use to register a subsystem with the global SubsystemManager.
///
public sealed class XRParticipantSubsystemDescriptor :
SubsystemDescriptorWithProvider
{
///
/// The capabilities of a particular . This is typically
/// used to query a subsystem for capabilities that might vary by platform or implementation.
///
[Flags]
public enum Capabilities
{
///
/// The implementation has no
/// additional capabilities other than the basic, required functionality.
///
None = 0,
}
///
/// The capabilities provided by this implementation.
///
public Capabilities capabilities { get; private set; }
///
/// Register a provider implementation.
/// This should only be used by subsystem implementors.
///
/// The name of the specific subsystem implementation.
/// The of the specific subsystem implementation.
/// The concrete type derived from being registered.
public static void Register(string subsystemId, Capabilities capabilities)
where T : XRParticipantSubsystem.Provider
{
SubsystemDescriptorStore.RegisterDescriptor(new XRParticipantSubsystemDescriptor(subsystemId, typeof(T), null, capabilities));
}
///
/// Register a provider implementation and subsystem override.
/// This should only be used by subsystem implementors.
///
/// The name of the specific subsystem implementation.
/// The of the specific subsystem implementation.
/// The concrete type of the provider being registered.
/// The concrete type of the subsystem being registered.
public static void Register(string subsystemId, Capabilities capabilities)
where TProvider : XRParticipantSubsystem.Provider
where TSubsystemOverride : XRParticipantSubsystem
{
SubsystemDescriptorStore.RegisterDescriptor(new XRParticipantSubsystemDescriptor(subsystemId, typeof(TProvider), typeof(TSubsystemOverride), capabilities));
}
XRParticipantSubsystemDescriptor(string subsystemId, Type providerType, Type subsystemTypeOverride, Capabilities capabilities)
{
id = subsystemId;
this.providerType = providerType;
this.subsystemTypeOverride = subsystemTypeOverride;
this.capabilities = capabilities;
}
}
}