Does anyone know of a way to assign an Axis or KeyCode to a GUI Button or Texture? I'm trying to make a 2D platformer on a mobile device. As you can tell, I have no Idea what I'm doing...

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class TouchInput : MonoBehaviour {
public Canvas touchControl;
public Button right;
public Button left;
public Button jump;

// Use this for initialization
void Start () {
	touchControl = touchControl.GetComponent<Canvas> ();
	right = right.GetComponent<Button> ();
	left = left.GetComponent<Button> ();
	jump = jump.GetComponent<Button> ();

	touchControl.enabled = true;

// Update is called once per frame
public void Jump() {
	Input.GetKeyDown (KeyCode.Space);


Something like this should work

void Update() {
    if (Input.GetKeyDown(KeyCode.Space)) {

There was a similar question here