mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Fix for unity 2022.3.62f3 not having get_graphicsDeviceID (#1235)
This commit is contained in:
1 file changed
+7
-1
@@ -48,7 +48,13 @@ namespace BepInEx.Bootstrap
|
||||
var prop = AccessTools.PropertyGetter(typeof(Application), "isBatchMode");
|
||||
if (prop != null)
|
||||
return (bool) prop.Invoke(null, null);
|
||||
return SystemInfo.graphicsDeviceID == 0;
|
||||
// Some Unity builds may miss this property, see
|
||||
// https://docs.unity3d.com/2022.3/Documentation/ScriptReference/SystemInfo-graphicsDeviceID.html
|
||||
var prop2 = AccessTools.PropertyGetter(typeof(SystemInfo), "graphicsDeviceID");
|
||||
if (prop2 != null)
|
||||
return ((int) prop2.Invoke(null, null)) == 0;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user