Input Manager & BaseEventData uses parameter that hides inherited property
See original GitHub issuethe tag
property when initializing event data hides inherited UnityEngine
property tag
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
First person controller. rigidbody hides inherited member ...
Hi I am getting this 'First person controller. rigidbody hides inherited member UnityEngine.Component.rigidbody' Use the keyword if hiding ...
Read more >Class EventSystem | Unity UI | 1.0.0
The EventSystem used to override UI Toolkit panel events and selection. If activeEventSystem is null, UI Toolkit panels will use current enabled ...
Read more >Class ExtendedPointerEventData | Input System | 1.0.2
An extension to PointerEventData which makes additional data about the input event available. Inheritance. Object. UnityEngine.EventSystems.
Read more >c# - Property hides inherited member
I have tried adding the override and virtual keywords, but that doesn't work. How can I make this warning go away? Edit. Here...
Read more >Stupid Unity UI Navigation Tricks
Here's a few tricks you can use to get a little more control over controller or keyboard ... Selectable objects like buttons have...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mrbobbybobberson, thanks for the details!
Yeah I actually just pushed an update that handles exactly that. Building a list of recognized controllers and handling them appropriately. Check out
GamePadInputSource.cs
on the master branch. I still need to work on how this will be compatible with the motion controllers though in the dev branch.Although, I’m really interested to see how the new Unity Input System is supposed to handle controllers in the future.
Hey @StephenHodgson, I used
tag
on a project a few months ago where we had to support 6DoF controllers, Xbox gamepads, and airtap. I created an enum calledAppCommand
with different high-level, app-specific commands (Teleport
,QueryData
,PlaceSensor
, etc). In my Unity project’s input settings, I defined Unity axes and mapped Xbox gamepad buttons to them. I made aUnityInputSource
class that inherited fromBaseInputSource
that processed the Unity axes and mapped them to the correctAppCommand
. I augmentedInteractionSourceInputSource
to assign the correctAppCommand
for 6DoF controller and airtap input. Then, in all of my input handlers, I just asked whichAppCommand
to decide how to interpret the input.That being said, I hear recent Unity betas may have started routing 6DoF controller buttons (and maybe even airtap and clicker?) through its Unity axes as well, which would make my distinction of the
UnityInputSource
and theInteractionSourceInputSource
break down, since I wouldn’t be able to tell which Unity axis inputs were from an Xbox gamepad versus a 6DoF controller. I’m not sure how I would have handled that… maybe I would have defined a Unity axis for each joystick number and then queried unity for the joystick name to decide what type of controller it was, but at that point, it would get pretty cumbersome, and a different solution might work better.As for an array of objects, since everything including arrays inherits from
object
, you can pass anobject[]
in as the tag. In your handlers, you just need to know to cast tag back toobject[]
similar to how I had to cast back to anAppCommand
.I hope that helps explain some of the rationale behind the tag.