using System.Linq; using UnityEngine.XR.Management; namespace UnityEngine.XR.ARFoundation.InternalUtils { static class XRManagerUtility { /// /// Returns if there is an active of /// type . Otherwise, . /// /// The type to check the active status of. /// if TLoader is active. Otherwise, . /// public static bool IsLoaderActive() where TLoader : XRLoader { var settingsInstance = XRGeneralSettings.Instance; if (settingsInstance == null) return false; var managerSettings = settingsInstance.Manager; if (managerSettings == null) return false; return managerSettings.activeLoaders?.OfType().Any() ?? false; } } }