Hello iam making a options menu and i would like the player to change the keys if he want too ex: change jump to another key, i have this right now:
public KeyCode Jump = KeyCode.Space;
GUILayout.BeginHorizontal();
GUILayout.Space(15);
GUILayout.Label("Jump:", Text);
GUILayout.FlexibleSpace();
if (GUILayout.Button("" + Jump, Button, GUILayout.Height(40), GUILayout.Width(260)))
{
if(Input.GetKeyDown(KeyCode.A))
Jump = KeyCode.A;
if (Input.GetKeyDown(KeyCode.AltGr))
Jump = KeyCode.AltGr;
if (Input.GetKeyDown(KeyCode.B))
Jump = KeyCode.B;
if (Input.GetKeyDown(KeyCode.Backspace))
Jump = KeyCode.Backspace;
if (Input.GetKeyDown(KeyCode.C))
Jump = KeyCode.C;
}
GUILayout.Space(15);
GUILayout.EndHorizontal();
is it possible to make it easier like instead of this
if(Input.GetKeyDown(KeyCode.A))
Jump = KeyCode.A;
if (Input.GetKeyDown(KeyCode.AltGr))
Jump = KeyCode.AltGr;
if (Input.GetKeyDown(KeyCode.B))
Jump = KeyCode.B;
if (Input.GetKeyDown(KeyCode.Backspace))
Jump = KeyCode.Backspace;
if (Input.GetKeyDown(KeyCode.C))
Jump = KeyCode.C;
my english is not so good and i hope you understand
thanks