Open AndersMalmgren opened 2 years ago
Forgot to expand the first allocation
Hey guys any news on this? It still allocates. Makes our game spike from GC collection
public static bool enabled
{
get
{
#if UNITY_2020_1_OR_NEWER || OPENVR_XR_API
if (XRSettings.supportedDevices.Length == 0)
enabled = false;
#else
if (!XRSettings.enabled)
enabled = false;
#endif
return _enabled;
}
set
{
_enabled = value;
if (_enabled)
{
Initialize();
}
else
{
SafeDispose();
}
}
}
UNity docs says, Returns a list of supported XR devices that were included at build time.
Seems safe to cache
@zite i have talked with unity and its safe and best practice to cache the result from getSupportedDevices
https://forum.unity.com/threads/xrsettings-get_supporteddevices-allocate.1364541/#post-8609667
This is a build player that I am benchmarking