VR4Medical/ICI/Library/PackageCache/com.unity.xr.openxr@3903c1059bcf/Samples~/InterceptFeature
2025-07-29 13:45:50 +03:00
..
Editor start 2025-07-29 13:45:50 +03:00
InterceptFeaturePlugin start 2025-07-29 13:45:50 +03:00
Editor.meta start 2025-07-29 13:45:50 +03:00
InterceptCreateSessionFeature.cs start 2025-07-29 13:45:50 +03:00
InterceptCreateSessionFeature.cs.meta start 2025-07-29 13:45:50 +03:00
InterceptFeature.unity start 2025-07-29 13:45:50 +03:00
InterceptFeature.unity.meta start 2025-07-29 13:45:50 +03:00
InterceptFeaturePlugin.meta start 2025-07-29 13:45:50 +03:00
InterceptMessageHandler.cs start 2025-07-29 13:45:50 +03:00
InterceptMessageHandler.cs.meta start 2025-07-29 13:45:50 +03:00
README.md start 2025-07-29 13:45:50 +03:00
README.md.meta start 2025-07-29 13:45:50 +03:00

Intercept Feature Sample

Demonstrates intercepting an OpenXR method using an OpenXR Feature.

The OpenXR API allows any of its functions to be intercepted by providing a custom xrGetInstanceProcAddr method. Within Unity this can be done by implementing a custom OpenXRFeature and overriding the HookGetInstanceProcAddr to provide an alternative version of the xrGetInstanceProcAddr method. Once in place this method can return alternative versions of any of the OpenXR methods. In this sample this mechanism is used to hook the xrCreateSession method such that each time xrCreateSession is called it will invoke a C# callback with a message string, which is then displayed on screen.

See the Unity OpenXR Documentation for more information on developing a custom feature.

See the OpenXR API Specification for more information on OpenXR.