Jump to content

Function Difference Between Get...() and Get...Ex()


Codest

Recommended Posts

I was just wondering what the difference was between regular and Ex functions, for example ViveInput.GetPress() and ViveInput.GetPressEx(). And would there be a reason to use one over the other?

     

Link to comment
Share on other sites

  • 4 weeks later...

Its a historical issue...

At first, ViveInput.GetPress only takes HandRole perameter.

After the Role Binding Update, custom role enum is supported.

I tried to add ViveInput.GetPress<TRole>(TRole role, ...) but the methods signature is ambiguous to ViveInput.GetPress(HandRole role, ...) because Unity was using older C# version.

(template specialization only supported in newer C# version)

It may not cause compile error if I just replace ViveInput.GetPress(HandRole role, ...) to ViveInput.GetPress<TRole>(TRole role, ...) but technically it changes the signature and also auto-completion for HandRole will be gone. (Considering developers will get panic when they don't know what TRole type should be)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...