using System;
using Unity.Collections;
using UnityEngine.XR.ARSubsystems;
namespace UnityEngine.XR.MagicLeap
{
static class SubsystemFeatures
{
const Feature kUniversallySupportedFeatures = Feature.AnyTrackingMode
| Feature.WorldFacingCamera
| Feature.PlaneTracking;
static readonly ConfigurationDescriptor[] s_ConfigurationsDescriptors = {
new ConfigurationDescriptor(IntPtr.Zero, kUniversallySupportedFeatures | Feature.Meshing, 0),
new ConfigurationDescriptor((IntPtr)1, kUniversallySupportedFeatures | Feature.PointCloud, 1)
};
public static Feature requestedFeatures { get; private set; } = Feature.None;
public static void SetFeatureRequested(Feature feature, bool value)
{
requestedFeatures = requestedFeatures.SetEnabled(feature, value);
}
public static Feature currentFeatures { get; private set; } = Feature.None;
public static void SetCurrentFeatureEnabled(Feature feature, bool value)
{
currentFeatures = currentFeatures.SetEnabled(feature, value);
}
public static unsafe NativeArray<ConfigurationDescriptor> AcquireConfigurationDescriptors(Allocator allocator)
=> new NativeArray<ConfigurationDescriptor>(s_ConfigurationsDescriptors, allocator);
}
}