Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToRole<TRole> constantly returns "Invalid" #6

Closed
ValakhP opened this issue Apr 6, 2017 · 2 comments
Closed

ToRole<TRole> constantly returns "Invalid" #6

ValakhP opened this issue Apr 6, 2017 · 2 comments
Labels

Comments

@ValakhP
Copy link

ValakhP commented Apr 6, 2017

When using ViveRoleProperty.ToRole<TRole>(), it returns Invalid everytime.

I guess, that the problem is in line 167:
if (m_roleType != typeof(TRole) || roleInfo.TryGetRoleByName(m_roleValueName, out role))

You have m_roleValueName parameter in method that is getting the role from Dictionary. After replacing it with m_roleTypeFullName everything works fine.

@lawwong lawwong added the bug label Apr 6, 2017
@lawwong
Copy link
Collaborator

lawwong commented Apr 6, 2017

Thanks, I actually missed a negation operator.
It should be
if (m_roleType != typeof(TRole) || !roleInfo.TryGetRoleByName(m_roleValueName, out role))
meaning that returns invalid if role type not match or the value string not found in roleInfo.

@ValakhP
Copy link
Author

ValakhP commented Apr 6, 2017

Oh, yeah. My bad. Anyway nice to have it fixed.

@jjwu168 jjwu168 closed this as completed in 8f78cb1 Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants