using System.Collections.Generic; #if !UNITY_2019_2_OR_NEWER using UnityEngine.Experimental; #endif namespace UnityEngine { public static class SubsystemRegistration { static readonly List k_SubsystemDescriptors = new List(); /// /// Registers a SubsystemDescriptor with the Subsystem Manager so that features and implementation type are available. /// /// The SubsystemDescriptor that describes the subsystem implementation. /// True if the descriptor does not already exist and registration happens, otherwise, False. public static bool CreateDescriptor(SubsystemDescriptor descriptor) { foreach (var declaration in k_SubsystemDescriptors) { if (descriptor.subsystemImplementationType == declaration.subsystemImplementationType) return false; } Internal_SubsystemDescriptors.Internal_AddDescriptor(descriptor); k_SubsystemDescriptors.Add(descriptor); return true; } } }