Our objectives will be to explore the EventSystem and modify the Input Manager.
So within the main menu scene here, notice the event system.
So of course this game object gets created whenever you create UI in your scene.
You should always keep it.
It's got a number of scripts attached here that
really provide the input mechanisms for our UI.
So one of the things to note is the stand alone input module.
So you can see there's a number of axes and buttons to find here.
So the horizontal and vertical axes is how we move through our menu, using horizontal
and vertical proper mappings back to whatever controls we're using.
You can see the Submit button.
That's how we actually select a menu item is Map to Submit.
And then there is also a touch input module
that basically provides the functionality for touch input.
Now the issue with controllers is that the Submit button isn't actually mapped
properly depending in your controller and depending on your platform.
So let me actually bring up the input manager.
So under Edit > Project > Input, of course we have our Input Manager here.
And let's look at Submit.
So Submit's actually in this list multiple times.
So the first time you can see Submit is tied to positive button returns.
So that's Return key on your keyboard and Button 0 is the alternate.
And the second Submit is tied to the Enter button on the keyboard.
Or the Space button on the keyboard.
So there's multiple ways to actually submit things on the keyboard.
And for Controller, Button 0 is the only mapping.
Now as you recall back earlier when we set up jumping, and
we looked at the button mappings for the XBox 360 controller,
the Unity 3D Wiki page, if I scroll down here.
Remember, Button 0 is tied to the a button on Windows and Linux but not on Mac.
It's, you know, Button 16 on the Mac.
So, what we could do is we could modify the Input Manager to include Button 16 as
another way to submit.
So, back in Unity all of these slots are unfortunately full, so
we've got the positive button and alternate positive in two spots.
We've got a variety of things.
We could take out one as an option and replace it, but
I wanna leave everything that's here because maybe people wanna use Return or
the Enter button on the keypad or something like that.
So what I would actually do is create a new axes, so here, when it says 18,
I'm gonna add a new one.
I'm gonna type 19.
And what it essentially does is it duplicates the last one
to the bottom here.
So I have two Cancels now, let me actually change this now to be a Submit.
And I'm gonna set the positive button to joy stick button 16,
and for alternate positive I'm just gonna remove that.
So, now that I have that set up, if I go ahead and test here on my Mac, and
with my controller, I can basically scroll down or scroll up using the directions.
And if I hit a, which is button 16, it should actually fire that off.
So I can do everything with the controller.
I don't have to take my hands off the controller and use the mouse or
use the keyboard to navigate my menus.