#pragma strict

function Start () {

}

function GetX(playID)
{
	return Input.GetAxis ("Horizontal_Player"+playID.ToString());
}

function GetY(playID)
{
	return Input.GetAxis ("Vertical_Player"+playID.ToString());
}

function GetTrigger(playID)
{
	return Input.GetAxis ("Trigger_Player"+playID.ToString());
}

function checkButton(playID)
{
	switch(playID)
	{
	case 1:
			if (Input.GetButtonDown ("Fire0_Player1")) {
				Debug.Log ("Il player 1 ha premuto VERDE");
				return(2);
			}

			if (Input.GetButtonDown ("Fire1_Player1")) {
				Debug.Log("Il Player 1 ha premuto ROSSO ");
				return(0);
			}

			if (Input.GetButtonDown ("Fire2_Player1")) {
				Debug.Log("Il Player 1 ha premuto BLU");
				return(3);
			}

			if (Input.GetButtonDown ("Fire3_Player1")) {
				Debug.Log("Il Player 1 ha premuto GIALLO");
				return(1);
			}

			if (Input.GetButtonDown ("Submit_Player1")) {
				Debug.Log("Il Player 1 ha premuto Start");
				return(10);
			}

			break;
		case 2:
			if (Input.GetButtonDown ("Fire0_Player2")) {
				Debug.Log ("Il player 2 ha premuto VERDE");
				return(2);
			}
			
			if (Input.GetButtonDown ("Fire1_Player2")) {
				Debug.Log("Il Player 2 ha premuto ROSSO");
				return(0);
			}
			
			if (Input.GetButtonDown ("Fire2_Player2")) {
				Debug.Log("Il Player 2 ha premuto BLU");
				return(3);
			}
			
			if (Input.GetButtonDown ("Fire3_Player2")) {
				Debug.Log("Il Player 2 ha premuto GIALLO");
				return(1);
			}
			
			if (Input.GetButtonDown ("Submit_Player2")) {
				Debug.Log("Il Player 2 ha premuto Start");
				return(10);
			}
			
			break;			    
		case 3:
			if (Input.GetButtonDown ("Fire0_Player3")) {
				Debug.Log ("Il player 3 ha premuto VERDE");
				return(2);
			}
			
			if (Input.GetButtonDown ("Fire1_Player3")) {
				Debug.Log("Il Player 3 ha premuto ROSSO");
				return(0);
			}
			
			if (Input.GetButtonDown ("Fire2_Player3")) {
				Debug.Log("Il Player 3 ha premuto BLU");
				return(3);
			}
			
			if (Input.GetButtonDown ("Fire3_Player3")) {
				Debug.Log("Il Player 3 ha premuto GIALLO");
				return(1);
			}
			
			if (Input.GetButtonDown ("Submit_Player3")) {
				Debug.Log("Il Player 3 ha premuto Start");
				return(10);
			}
			
			break;
		case 4:
			if (Input.GetButtonDown ("Fire0_Player4")) {
				Debug.Log ("Il player 1 ha premuto VERDE");
				return(2);
			}
			
			if (Input.GetButtonDown ("Fire1_Player4")) {
				Debug.Log("Il Player 1 ha premuto ROSSO");
				return(0);
			}
			
			if (Input.GetButtonDown ("Fire2_Player4")) {
				Debug.Log("Il Player 1 ha premuto BLU");
				return(3);
			}
			
			if (Input.GetButtonDown ("Fire3_Player4")) {
				Debug.Log("Il Player 1 ha premuto GIALLO");
				return(1);
			}
			
			if (Input.GetButtonDown ("Submit_Player4")) {
				Debug.Log("Il Player 4 ha premuto Start");
				return(10);
			}
			
			break;
		default:
			return -1;
		}
		return -1;
}

function Update () {

}