microsoft / OpenXR-Unity-MixedReality-Samples

Sample Unity projects to demo how to use OpenXR plugin in Unity for HoloLens 2 and Mixed Reality headsets
MIT License
250 stars 71 forks source link

Expose internal subsystem types #183

Closed sjando closed 6 months ago

sjando commented 6 months ago

Subsystem class definitions in Mixed Reality OpenXR plugin are all internal. This makes it more cumbersome than it should be implement platform-specific behaviour. i.e. we should be able to do:

if (subsystem is AnchorSubsystem s)
{
    // do HL2-specific stuff
}

but instead, we have to do something ugly and error-prone:

if (subsystem.GetType().Name == "AnchorSubsystem")
{
    // do HL2-specific stuff
}

Please consider exposing subsystem types. I know in this plugin platform-specific members are not typically added on the subsystem class directly (and have in some cases been exposed via e.g. extension methods), but this is still nice pattern to enable with no downside.

By comparison, com.unity.xr.meta-openxr declares all its AR subsystem types as public.

AMollis commented 6 months ago

Thank you for the feedback. Unfortunately, this is not something we are able to expose at this time. We will track this feedback internally, and let you know if this changes in the future.