using UnityEngine;
using System.Collections;

public class Selection : MonoBehaviour {

	public GameObject[] player;


	void Start(){
		GameObject[] jogador = GameObject.FindGameObjectsWithTag ("Player");
		foreach ( GameObject j in jogador){
			Destroy(j);
		}
	}
	// Update is called once per frame
	void Update () {

		int i;

		if(Input.GetButton("Fire1"))
		{
			i = 0;
			Instantiate(player[0]);
			Application.LoadLevel (2);
		}
		if(Input.GetButton("Fire2"))
		{
			i = 1;
			Instantiate(player[1]);
			Application.LoadLevel (2);

		}
		if(Input.GetButton("Fire3"))
		{
			i = 2;
			Instantiate(player[2]);
			Application.LoadLevel (2);
		}


	}
}
