Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

SubsystemRegistration.cs 1.3KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections.Generic;
  2. #if !UNITY_2019_2_OR_NEWER
  3. using UnityEngine.Experimental;
  4. #endif
  5. #pragma warning disable CS0618
  6. namespace UnityEngine
  7. {
  8. public static class SubsystemRegistration
  9. {
  10. static readonly List<SubsystemDescriptor> k_SubsystemDescriptors = new List<SubsystemDescriptor>();
  11. /// <summary>
  12. /// Registers a <c>SubsystemDescriptor</c> with the Subsystem Manager so that features and implementation type are available.
  13. /// </summary>
  14. /// <param name="descriptor"> The <c>SubsystemDescriptor</c> that describes the subsystem implementation.</param>
  15. /// <returns><c>True</c> if the descriptor does not already exist and registration happens, otherwise, <c>False</c>.</returns>
  16. public static bool CreateDescriptor(SubsystemDescriptor descriptor)
  17. {
  18. foreach (var declaration in k_SubsystemDescriptors)
  19. {
  20. if (descriptor.subsystemImplementationType == declaration.subsystemImplementationType)
  21. return false;
  22. }
  23. Internal_SubsystemDescriptors.Internal_AddDescriptor(descriptor);
  24. k_SubsystemDescriptors.Add(descriptor);
  25. return true;
  26. }
  27. }
  28. }
  29. #pragma warning restore CS0618