Files
adriadri6972 d3d9c5f833 upload project
2025-07-31 15:21:08 +02:00

35 lines
864 B
C#

using UnityEngine.XR.Management;
namespace UnityEngine.XR.Simulation
{
static class Api
{
#if UNITY_STANDALONE || UNITY_EDITOR
public static bool supported => true;
#else
public static bool supported => false;
#endif
public static bool loaderPresent => FindLoader() != null;
static SimulationLoader FindLoader()
{
var instance = XRGeneralSettings.Instance;
if (instance == null)
return null;
var manager = instance.Manager;
if (manager == null || manager.activeLoaders == null)
return null;
foreach (var loader in manager.activeLoaders)
{
if (loader is SimulationLoader simulationLoader)
return simulationLoader;
}
return null;
}
}
}