MixedRealityToolkit / MixedRealityToolkit-Unity

This repository holds the third generation of the Mixed Reality Toolkit for Unity. The latest version of the MRTK can be found here.
BSD 3-Clause "New" or "Revised" License
398 stars 104 forks source link

[BUG] Deprecated `XRBaseControllerInteractor` in XRI 3.0.0-pre.1 breaks `GazePinchInteractor` #605

Closed ahmed-shariff closed 5 months ago

ahmed-shariff commented 9 months ago

Describe the bug

When upgrading to XRI 3.0.0-pre.1 I get the following error:

Library\PackageCache\org.mixedrealitytoolkit.input@719fc273754c\Interactors\GazePinch\GazePinchInteractor.cs(350,45): error CS8121: An expression of type 'XRBaseControllerInteractor' cannot be handled by a pattern of type 'FuzzyGazeInteractor'.

Additional context

In XRI 3.0.0 XRBaseControllerInteractor is being deprecated and replaced with XRBaseInputInteractor (https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.0/changelog/CHANGELOG.html).

Potential fix

Looking through the code, GazePinchInteractor.DependentInteractor can be a XRBaseInteractor as only the IXRInteractor.GetValidTargets is being used in GazePinchInteractor. Both XRBaseControllerInteractor and XRBaseInputInteractor extend this as well. This also should not conflict with GazeInteractor as it extends XRRayInteractor, which is extending the appropriate class on both version (XRBaseControllerInteractor in 2.5.2 and XRBaseInputInteractor in 3.0.0-pre.1)

ahmed-shariff commented 9 months ago

Changing GazePinchInteractor.DependentInteractor to XRBaseInteractor is passing all test on the master branch. I can submit a PR with the fix if that makes sense.

AMollis commented 9 months ago

@ahmed-shariff , please make a PR if you are able to unblock yourself. However, we are aware that XRI 3.0 has breaking changes that need to be addressed in MRTK3 (Feature Issue Pending).

ahmed-shariff commented 9 months ago

@AMollis if there is any part I could help with addressing the XRI changes, please feel free to let me know. I'd be happy to help.

AMollis commented 9 months ago

We're looking into the best approach to fix this issue. Please stay tuned for updates

shaynie commented 5 months ago

Duplicate of #645