Skip to content

Commit 2d52885

Browse files
committed
Cache IsSupported result to avoid redundant checks
1 parent 08b7c94 commit 2d52885

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Unity-QuestVisionKit/Assets/PassthroughCameraApiSamples/PassthroughCamera/Scripts/PassthroughCameraUtils.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public static bool IsSupported
6363
if (!s_isSupported.HasValue)
6464
{
6565
var headset = OVRPlugin.GetSystemHeadsetType();
66-
return (headset == OVRPlugin.SystemHeadset.Meta_Quest_3 ||
67-
headset == OVRPlugin.SystemHeadset.Meta_Quest_3S) &&
68-
(!HorizonOSVersion.HasValue || HorizonOSVersion >= MINSUPPORTOSVERSION);
66+
s_isSupported = (headset == OVRPlugin.SystemHeadset.Meta_Quest_3 ||
67+
headset == OVRPlugin.SystemHeadset.Meta_Quest_3S) &&
68+
(!HorizonOSVersion.HasValue || HorizonOSVersion >= MINSUPPORTOSVERSION);
6969
}
7070

7171
return s_isSupported.Value;

0 commit comments

Comments
 (0)