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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...