Mixedrealitytoolkit-unity: Flag enum "Handedness" not binary compared (there's probably more)

Created on 29 Aug 2019  路  5Comments  路  Source: microsoft/MixedRealityToolkit-Unity

Not really a bug, but since Handedness is an enum flag, code could be refactored in that it properly does a binary comparison.
I've seen things like value == any || value == both, where any already includes both.

4 - In Review Bug

All 5 comments

@alexees what code are you referring to? Any and both are actually different.

Both only includes Left | Right
Any includes Other | Both

Could possibly replace many of these comparisons with HasFlag

Maybe a simpler line would simply be
pointerProfile.Handedness.HasFlag(controllingHand)?

Oh nice.
You're finding bit check all over the place but nobody mentions this method :)

Was this page helpful?
0 / 5 - 0 ratings